星火(1.5.2)Dataframes之间的差异计算 [英] Computing difference between Spark (1.5.2) Dataframes

查看:150
本文介绍了星火(1.5.2)Dataframes之间的差异计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个dataframes DF1 DF2 。我想计算第三个数据帧 DF3 ,使得 DF3 =(DF1 - DF2)即所有元素present在DF1但不是在DF2。是否有任何内置的库函数来实现的东西像 df1.subtract(DF2)

I have two dataframes df1 and df2. I want to compute a third dataframe df3 such that df3 = (df1 - df2) i.e all elements present in df1 but not in df2. Is there any in-built library function to achieve that something like df1.subtract(df2)?

推荐答案

您可能正在寻找除了功能:的http://spark.apache.org/docs/1.5.2/api/scala/index.html#org.apache.spark.sql.DataFrame

You are probably searching for except function: http://spark.apache.org/docs/1.5.2/api/scala/index.html#org.apache.spark.sql.DataFrame

这说明:

除了高清(另:数据帧):数据帧

def except(other: DataFrame): DataFrame

返回一个包含此帧,而不是在行的新数据框
  另一帧。这相当于在SQL中,除了

Returns a new DataFrame containing rows in this frame but not in another frame. This is equivalent to EXCEPT in SQL.

这篇关于星火(1.5.2)Dataframes之间的差异计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆