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


##########
python/pyspark/sql/table_arg.py:
##########
@@ -0,0 +1,52 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+from typing import TYPE_CHECKING
+
+from pyspark.sql.classic.column import _to_java_column, _to_seq
+from pyspark.sql.tvf_argument import TableValuedFunctionArgument
+from pyspark.sql.utils import get_active_spark_context
+
+
+if TYPE_CHECKING:
+    from py4j.java_gateway import JavaObject
+    from pyspark.sql._typing import ColumnOrName
+
+
+class TableArg(TableValuedFunctionArgument):
+    def __init__(self, j_table_arg: "JavaObject"):
+        self._j_table_arg = j_table_arg
+
+    def partitionBy(self, *cols: "ColumnOrName") -> "TableArg":
+        sc = get_active_spark_context()
+        if len(cols) == 1 and isinstance(cols[0], list):
+            cols = cols[0]

Review Comment:
   Added tests 
https://github.com/apache/spark/pull/49055/commits/61e52a75a4125c5cb497a0de4b84f29c9b6f877e.



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