<console>:29: error: overloaded method value join with alternatives:(right: org.apache.spark.sql.Dataset[_],joinExprs: org.apache.spark.sql.Column)org.apache.spark.sql.DataFrame <and>

在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 了一下就好了

--------------------------------记录一下---------------------------------

 

posted @ 2020-11-01 23:21  IT界的一名小学生  阅读(1056)  评论(0编辑  收藏  举报