【发布时间】:2020-01-23 19:49:14
【问题描述】:
从this问题复制示例: 作为一个概念示例,如果我有两个数据框:
words = [the, quick, fox, a, brown, fox]
stopWords = [the, a]
那么我希望输出是任意顺序:
words - stopWords = [quick, brown, fox, fox]
ExceptAll 可以在 2.4 中执行此操作,但我无法升级。链接问题中的答案特定于数据框:
words.join(stopwords, words("id") === stopwords("id"), "left_outer")
.where(stopwords("id").isNull)
.select(words("id")).show()
因为您需要知道 pkey 和其他列。
谁能想出一个适用于任何数据框的答案?
【问题讨论】:
标签: scala apache-spark apache-spark-sql