amaliujia commented on code in PR #38866:
URL: https://github.com/apache/spark/pull/38866#discussion_r1037556630
##########
python/pyspark/sql/connect/plan.py:
##########
@@ -721,8 +721,19 @@ def plan(self, session: "SparkConnectClient") ->
proto.Relation:
rel.join.using_columns.append(self.on)
else:
rel.join.join_condition.CopyFrom(self.to_attr_or_expression(self.on, session))
- else:
- rel.join.using_columns.extend(self.on)
+ elif len(self.on) > 0:
+ if isinstance(self.on[0], str):
+ rel.join.using_columns.extend(self.on) # ignore: arg-type
Review Comment:
```
python/pyspark/sql/connect/plan.py:726: error: Argument 1 to "extend" of
"RepeatedScalarFieldContainer" has incompatible type "Union[List[str],
List[Column]]"; expected "Optional[Iterable[str]]" [arg-type]
```
##########
python/pyspark/sql/connect/plan.py:
##########
@@ -721,8 +721,19 @@ def plan(self, session: "SparkConnectClient") ->
proto.Relation:
rel.join.using_columns.append(self.on)
else:
rel.join.join_condition.CopyFrom(self.to_attr_or_expression(self.on, session))
- else:
- rel.join.using_columns.extend(self.on)
+ elif len(self.on) > 0:
+ if isinstance(self.on[0], str):
+ rel.join.using_columns.extend(self.on) # ignore: arg-type
+ else:
+ merge_column = None
+ for c in self.on:
+ if merge_column is not None:
+ merge_column = merge_column & c
+ else:
+ merge_column = c
+ rel.join.join_condition.CopyFrom(
+ merge_column.to_plan(session) # ignore: union-attr
Review Comment:
```
python/pyspark/sql/connect/plan.py:735: error: Item "str" of "Union[str,
Column, None]" has no attribute "to_plan" [union-attr]
python/pyspark/sql/connect/plan.py:735: error: Item "None" of "Union[str,
Column, None]" has no attribute "to_plan" [union-attr]
```
--
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]