amaliujia commented on code in PR #38243:
URL: https://github.com/apache/spark/pull/38243#discussion_r995197709
##########
python/pyspark/sql/connect/plan.py:
##########
@@ -368,21 +368,45 @@ def __init__(
left: Optional["LogicalPlan"],
right: "LogicalPlan",
on: "ColumnOrString",
- how: proto.Join.JoinType.ValueType =
proto.Join.JoinType.JOIN_TYPE_INNER,
+ how: Optional[str],
) -> None:
super().__init__(left)
self.left = cast(LogicalPlan, left)
self.right = right
self.on = on
if how is None:
- how = proto.Join.JoinType.JOIN_TYPE_INNER
- self.how = how
+ join_type = proto.Join.JoinType.JOIN_TYPE_INNER
+ elif how == "inner":
+ join_type = proto.Join.JoinType.JOIN_TYPE_INNER
+ elif how in ["outer", "full", "fullouter"]:
+ join_type = proto.Join.JoinType.JOIN_TYPE_FULL_OUTER
+ elif how in ["leftouter", "left"]:
+ join_type = proto.Join.JoinType.JOIN_TYPE_LEFT_OUTER
+ elif how in ["rightouter", "right"]:
+ join_type = proto.Join.JoinType.JOIN_TYPE_RIGHT_OUTER
+ elif how in ["leftsemi", "semi"]:
+ join_type = proto.Join.JoinType.JOIN_TYPE_LEFT_SEMI
+ elif how in ["leftanti", "anti"]:
+ join_type = proto.Join.JoinType.JOIN_TYPE_LEFT_ANTI
+ else:
Review Comment:
Note that in https://github.com/apache/spark/pull/38157 the feedback was to
not support CROSS join so it is not listed here. Whenever it makes sense to
have CROSS join then adding the support will be easy and fast.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]