-
- Downloads
[SPARK-13427][SQL] Support USING clause in JOIN.
## What changes were proposed in this pull request? Support queries that JOIN tables with USING clause. SELECT * from table1 JOIN table2 USING <column_list> USING clause can be used as a means to simplify the join condition when : 1) Equijoin semantics is desired and 2) The column names in the equijoin have the same name. We already have the support for Natural Join in Spark. This PR makes use of the already existing infrastructure for natural join to form the join condition and also the projection list. ## How was the this patch tested? Have added unit tests in SQLQuerySuite, CatalystQlSuite, ResolveNaturalJoinSuite Author: Dilip Biswal <dbiswal@us.ibm.com> Closes #11297 from dilipbiswal/spark-13427.
Showing
- sql/catalyst/src/main/antlr3/org/apache/spark/sql/catalyst/parser/FromClauseParser.g 8 additions, 1 deletion...3/org/apache/spark/sql/catalyst/parser/FromClauseParser.g
- sql/catalyst/src/main/antlr3/org/apache/spark/sql/catalyst/parser/SparkSqlParser.g 1 addition, 0 deletions...lr3/org/apache/spark/sql/catalyst/parser/SparkSqlParser.g
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala 57 additions, 36 deletions...ala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala 7 additions, 0 deletions...rg/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala 2 additions, 0 deletions...a/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/CatalystQl.scala 33 additions, 16 deletions...ala/org/apache/spark/sql/catalyst/parser/CatalystQl.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/joinTypes.scala 8 additions, 0 deletions...scala/org/apache/spark/sql/catalyst/plans/joinTypes.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicOperators.scala 3 additions, 2 deletions...che/spark/sql/catalyst/plans/logical/basicOperators.scala
- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveNaturalJoinSuite.scala 50 additions, 24 deletions...spark/sql/catalyst/analysis/ResolveNaturalJoinSuite.scala
- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/CatalystQlSuite.scala 21 additions, 0 deletions...rg/apache/spark/sql/catalyst/parser/CatalystQlSuite.scala
- sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala 5 additions, 34 deletionssql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
- sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala 64 additions, 0 deletions...e/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
Loading
Please register or sign in to comment