-
- Downloads
[SPARK-20576][SQL] Support generic hint function in Dataset/DataFrame
## What changes were proposed in this pull request? We allow users to specify hints (currently only "broadcast" is supported) in SQL and DataFrame. However, while SQL has a standard hint format (/*+ ... */), DataFrame doesn't have one and sometimes users are confused that they can't find how to apply a broadcast hint. This ticket adds a generic hint function on DataFrame that allows using the same hint on DataFrames as well as SQL. As an example, after this patch, the following will apply a broadcast hint on a DataFrame using the new hint function: ``` df1.join(df2.hint("broadcast")) ``` ## How was this patch tested? Added a test case in DataFrameJoinSuite. Author: Reynold Xin <rxin@databricks.com> Closes #17839 from rxin/SPARK-20576.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveHints.scala 7 additions, 1 deletion...org/apache/spark/sql/catalyst/analysis/ResolveHints.scala
- sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala 16 additions, 0 deletionssql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
- sql/core/src/test/scala/org/apache/spark/sql/DataFrameJoinSuite.scala 17 additions, 1 deletion.../test/scala/org/apache/spark/sql/DataFrameJoinSuite.scala
Please register or sign in to comment