GitHub user gatorsmile opened a pull request: https://github.com/apache/spark/pull/20384
[SPARK-23195] [SQL] Keep the Hint of Cached Data ## What changes were proposed in this pull request? The broadcast hint of the cached plan is lost if we cache the plan. This PR is to correct it. ```Scala val df1 = spark.createDataFrame(Seq((1, "4"), (2, "2"))).toDF("key", "value") val df2 = spark.createDataFrame(Seq((1, "1"), (2, "2"))).toDF("key", "value") broadcast(df2).cache() df2.collect() val df3 = df1.join(df2, Seq("key"), "inner") ``` ## How was this patch tested? Added a test. You can merge this pull request into a Git repository by running: $ git pull https://github.com/gatorsmile/spark test33 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/20384.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #20384 ---- commit 4ef18b76b13c35dbec0d9e8ecfa753c9b4a80d2c Author: gatorsmile <gatorsmile@...> Date: 2018-01-24T15:27:52Z fix commit 3bbec210bcfd759d36a6f7e809ed0f1e3d0a03d8 Author: gatorsmile <gatorsmile@...> Date: 2018-01-24T15:28:06Z fix ---- --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org