GitHub user gatorsmile opened a pull request: https://github.com/apache/spark/pull/20368
[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 cachedBroadcastHint Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/20368.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 #20368 ---- commit 21e5321d072c312e243407af08eeb9c1a796ab4d Author: gatorsmile <gatorsmile@...> Date: 2018-01-23T20:40:04Z fix ---- --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org