【问题标题】:Spark 2.2 Structured Streaming Stream - Static left outer join issueSpark 2.2 Structured Streaming Stream - 静态左外连接问题
【发布时间】:2019-03-06 04:17:06
【问题描述】:

我似乎在 Stream 上遗漏了一些东西 - Spark 2.2 中的静态加入。

手册指出这样的连接是可能的,但我无法获得正确的语法。奇怪的。没有使用水印。

val joinedDs = salesDs
  .join(customerDs, "customerId", joinType="leftOuter")

得到的错误如下,但我很确定我是正确的:

<console>:81: error: overloaded method value join with alternatives:
  (right: org.apache.spark.sql.Dataset[_],joinExprs: 
org.apache.spark.sql.Column,joinType: String)org.apache.spark.sql.DataFrame <and>
  (right: org.apache.spark.sql.Dataset[_],usingColumns: Seq[String],joinType: String)org.apache.spark.sql.DataFrame
 cannot be applied to (org.apache.spark.sql.Dataset[Customer], String, joinType: String)
         .join(customerDs, "customerId", joinType="left_Outer")
          ^

【问题讨论】:

    标签: spark-structured-streaming


    【解决方案1】:

    由于某种原因,在添加 joinType 时,我还需要添加 Seq。

      .join(customerDs, Seq("customerId"), "left_Outer")
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-07
      • 2019-03-17
      • 2020-03-19
      • 1970-01-01
      • 2023-01-20
      • 2020-12-10
      • 2020-09-12
      相关资源
      最近更新 更多