Created
August 16, 2018 09:57
-
-
Save rberenguel/5def30c7560e2ff3230616e704cce289 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Foo(id: String, value: Int) | |
case class Bar(theId: String, value: Int) | |
val ds = List(Foo("Alice", 42), Foo("Bob", 43)).toDS | |
import org.apache.spark.sql.{DataFrame, Dataset} | |
val renamedDF: DataFrame = ds.select($"id".as("theId"), $"value") | |
val renamedDS: Dataset[Bar] = renamedDF.toDF("theId", "value").as[Bar] | |
renamedDF.where($"id" === "Alice").show | |
renamedDS.where($"id" === "Alice").show |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some println added to PushDownPredicate to investigate this: