HyukjinKwon opened a new pull request #28160: [SPARK-30722][DOCS][FOLLOW-UP] 
Explicitly mention the same entire input/output length restriction of Series 
Iterator UDF
URL: https://github.com/apache/spark/pull/28160
 
 
   ### What changes were proposed in this pull request?
   
   This PR explicitly mention that the requirement of Iterator of Series to 
Iterator of Series and Iterator of Multiple Series to Iterator of Series 
(previously Scalar Iterator pandas UDF).
   
   The actual limitation of this UDF is the same length of the _entire input 
and output_, instead of each series's length. Namely you can do something as 
below:
   
   ```python
   from typing import Iterator, Tuple
   import pandas as pd
   from pyspark.sql.functions import pandas_udf       
   
   @pandas_udf("long")
   def func(
           iterator: Iterator[pd.Series]) -> Iterator[pd.Series]:
       return iter([pd.concat(iterator)])
   
   spark.range(100).select(func("id")).show()
   ```
   
   This characteristic allows you to prefetch the data from the iterator to 
speed up, compared to the regular Scalar to Scalar (previously Scalar pandas 
UDF).
   
   ### Why are the changes needed?
   
   To document the correct restriction and characteristics of a feature.
   
   ### Does this PR introduce any user-facing change?
   
   Yes in the documentation but only in unreleased branches.
   
   ### How was this patch tested?
   
   Github Actions should test the documentation build 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to