我试图在这里做的是过滤行,其中log_type = "1"
这是我的代码:的方法过滤器的参数太多
val sc1Rdd=parDf.select(parDf("token"),parDf("log_type")).rdd
val sc2Rdd=sc1Rdd.filter(x=>x,log_type=="1")
但错误代码显示:
parDf: org.apache.spark.sql.DataFrame = [action_time: bigint, action_type: bigint ... 21 more fields] sc1Rdd: org.apache.spark.rdd.RDD[org.apache.spark.sql.Row] = MapPartitionsRDD[865] at rdd at :186 :188: error: too many arguments for method filter: (f: org.apache.spark.sql.Row => Boolean)org.apache.spark.rdd.RDD[org.apache.spark.sql.Row] val sc2Rdd=sc1Rdd.filter(x=>x,log_type=="1")
任何帮助将不胜感激。
是long_type的列名吗? –
谢谢你的帮助。问题解决了 – WW0512