【问题标题】:Computing difference between Spark DataFramesSpark DataFrame 之间的计算差异
【发布时间】:2016-02-16 21:27:18
【问题描述】:

我有两个 DataFrames df1df2。我想计算第三个 DataFrame ``df3 使得 df3 = (df1 - df2) 即所有元素都存在于 df1 但不在 df2 中。是否有任何内置库函数可以实现类似df1.subtract(df2) 的功能?

【问题讨论】:

    标签: apache-spark


    【解决方案1】:

    您可能正在搜索except函数:http://spark.apache.org/docs/1.5.2/api/scala/index.html#org.apache.spark.sql.DataFrame

    来自描述:

    def except(other: DataFrame): DataFrame

    返回一个新的 DataFrame,其中包含此帧中的行但不包含 另一个框架。这相当于 SQL 中的 EXCEPT。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-02
      • 2020-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多