xinrong-meng commented on code in PR #49424:
URL: https://github.com/apache/spark/pull/49424#discussion_r1936150923


##########
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:
   We might need this otherwise
   ```py
   pyspark.errors.exceptions.connect.SparkConnectGrpcException: 
(org.apache.spark.sql.connect.common.InvalidPlanInput) Missing tableArgOptions 
for SUBQUERY_TYPE_TABLE_ARG
   ```
   for df.asTable with no chaining methods.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to