Yicong Huang created SPARK-56937:
------------------------------------
Summary: Raise error on wrong column count in Arrow
grouped/cogrouped map UDF (positional mode)
Key: SPARK-56937
URL: https://issues.apache.org/jira/browse/SPARK-56937
Project: Spark
Issue Type: Sub-task
Components: PySpark
Affects Versions: 4.2.0
Reporter: Yicong Huang
verify_arrow_result in python/pyspark/worker.py uses zip(expected, actual) in
the positional branch (when
spark.sql.legacy.execution.pandas.groupedMap.assignColumnsByName=false), which
silently truncates to the shorter list when the user-defined function returns
the wrong number of columns. Affected eval types: SQL_GROUPED_MAP_ARROW_UDF,
SQL_GROUPED_MAP_ARROW_ITER_UDF, SQL_COGROUPED_MAP_ARROW_UDF. The name-based
branch already raises RESULT_COLUMN_NAMES_MISMATCH on missing/extra columns;
the positional branch should symmetrically raise RESULT_COLUMN_SCHEMA_MISMATCH
on length mismatch. This has been latent since SPARK-40559 (Dec 2023).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]