我知道有几个转换可以保留父分区(如果之前设置过 - 例如mapValues),而有些转换不保留它(例如map)。
我使用 Spark 2.2 的数据集 API。我的问题是 -dropDuplicates转换是否保留分区?想象一下这段代码:
case class Item(one: Int, two: Int, three: Int)
import session.implicits._
val ds = session.createDataset(List(Item(1,2,3), Item(1,2,3)))
val repart = ds.repartition('one, 'two).cache()
repart.dropDuplicates(List("one", "two")) // will be partitioning preserved?
Run Code Online (Sandbox Code Playgroud)