forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-42929] make mapInPandas / mapInArrow support "is_barrier"
### What changes were proposed in this pull request? make mapInPandas / mapInArrow support "is_barrier" ### Why are the changes needed? feature parity. ### Does this PR introduce _any_ user-facing change? Yes. ### How was this patch tested? Manually: `bin/pyspark --remote local`: ``` from pyspark.sql.functions import pandas_udf df = spark.createDataFrame([(1, 21), (2, 30)], ("id", "age")) def filter_func(iterator): for pdf in iterator: yield pdf[pdf.id == 1] df.mapInPandas(filter_func, df.schema, is_barrier=True).collect() def filter_func(iterator): for batch in iterator: pdf = batch.to_pandas() yield pyarrow.RecordBatch.from_pandas(pdf[pdf.id == 1]) df.mapInArrow(filter_func, df.schema, is_barrier=True).collect() ``` Closes apache#40559 from WeichenXu123/spark-connect-barrier-mode. Authored-by: Weichen Xu <[email protected]> Signed-off-by: Weichen Xu <[email protected]>
- Loading branch information
1 parent
c55c7ea
commit 2a1ac07
Showing
6 changed files
with
70 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.