dtenedor commented on code in PR #42420:
URL: https://github.com/apache/spark/pull/42420#discussion_r1297784284
##########
python/pyspark/worker.py:
##########
@@ -573,9 +574,73 @@ def read_udtf(pickleSer, infile, eval_type):
f"The return type of a UDTF must be a struct type, but got
{type(return_type)}."
)
+ class UDTFWithPartitions:
+ """
+ This implements the logic of a UDTF that accepts an input TABLE
argument with one or more
+ PARTITION BY expressions.
+
+ Parameters
+ ----------
+ create_udtf: function
+ Function to create a new instance of the UDTF to be invoked.
+ partition_child_indexes: list
+ List of integers identifying zero-based indexes of the columns of
the input table that
+ contain projected partitioning expressions. This class will
inspect these values for
+ each pair of consecutive input rows. When they change, this
indicates the boundary
+ between two partitions, and we will invoke the 'terminate' method
on the UDTF class
+ instance and then destroy it and create a new one to implement the
desired partitioning
+ semantics.
Review Comment:
@ueshin told me to put it under the `class` :) I moved the Parameters part
under `__init__` and left a general description under the `class`.
--
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]