ueshin commented on code in PR #49424:
URL: https://github.com/apache/spark/pull/49424#discussion_r1936198473


##########
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -3835,6 +3835,24 @@ class SparkConnectPlanner(
         UnresolvedScalarSubqueryPlanId(planId)
       case proto.SubqueryExpression.SubqueryType.SUBQUERY_TYPE_EXISTS =>
         UnresolvedExistsPlanId(planId)
+      case proto.SubqueryExpression.SubqueryType.SUBQUERY_TYPE_TABLE_ARG =>
+        if (!getSubqueryExpression.hasTableArgOptions) {
+          throw InvalidPlanInput("Missing tableArgOptions for 
SUBQUERY_TYPE_TABLE_ARG")
+        }

Review Comment:
   Why is this invalid? Isn't `TableArgOptions` optional?



##########
python/pyspark/sql/connect/expressions.py:
##########
@@ -1268,7 +1278,37 @@ def to_plan(self, session: "SparkConnectClient") -> 
proto.Expression:
             expr.subquery_expression.subquery_type = 
proto.SubqueryExpression.SUBQUERY_TYPE_SCALAR
         elif self._subquery_type == "exists":
             expr.subquery_expression.subquery_type = 
proto.SubqueryExpression.SUBQUERY_TYPE_EXISTS
+        elif self._subquery_type == "table_arg":
+            expr.subquery_expression.subquery_type = (
+                proto.SubqueryExpression.SUBQUERY_TYPE_TABLE_ARG
+            )
+
+            if not expr.subquery_expression.HasField("table_arg_options"):
+                expr.subquery_expression.table_arg_options.SetInParent()

Review Comment:
   See the comment above.



-- 
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]

Reply via email to