在scala中执行如下代码,报 join 错误!!
scala> val data = itemTotalTime.join(totalTime, "userId")
错误日志如下:
<console>:29: error: overloaded method value join with alternatives: (right: org.apache.spark.sql.Dataset[_],usingColumns: Seq[String])org.apache.spark.sql.DataFrame <and> (right: org.apache.spark.sql.Dataset[_],usingColumn: String)org.apache.spark.sql.DataFrame cannot be applied to (Unit, String) val data = itemTotalTime.join(totalTime, "userId") ^
分析:应该是join的一边是DataFram 一边是Dataset 的原因,我把这两个 itemTotalTime、totalTime 都 .toDF 了一下就好了
--------------------------------记录一下---------------------------------