-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-40879][CONNECT] Support Join UsingColumns in proto #38345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -238,13 +238,17 @@ package object dsl { | |
| def join( | ||
| otherPlan: proto.Relation, | ||
| joinType: JoinType = JoinType.JOIN_TYPE_INNER, | ||
| usingColumns: Seq[String] = Seq(), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's add an overload of
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like only one overloaded version can have default arguments: [ERROR] /Users/rui.wang/Documents/open-source-spark/spark/connector/connect/src/main/scala/org/apache/spark/sql/connect/dsl/package.scala:176: in class DslLogicalPlan, multiple overloaded alternatives of method join define default arguments. I ended up with adding a few more overloaded version of |
||
| condition: Option[proto.Expression] = None): proto.Relation = { | ||
| val relation = proto.Relation.newBuilder() | ||
| val join = proto.Join.newBuilder() | ||
| join | ||
| .setLeft(logicalPlan) | ||
| .setRight(otherPlan) | ||
| .setJoinType(joinType) | ||
| if (usingColumns.nonEmpty) { | ||
| join.addAllUsingColumns(usingColumns.asJava) | ||
| } | ||
| if (condition.isDefined) { | ||
| join.setJoinCondition(condition.get) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can join_condition and using_columns co-exist?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the current Catalyst implementation. My read is yes.
My understanding is current Catalyst implementation does not support
JOIN USING col_name,...in the join_condition. It is a separate code path. Is it true?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the API layer (DF and SQL), I don't think they can co-exist. E.g. the parser rule is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. To match with our API (but not implementation), I added a check to make sure only one of these two will be set.