Allison Wang created SPARK-44640:
------------------------------------
Summary: Improve error messages for invalid Python UDTF return type
Key: SPARK-44640
URL: https://issues.apache.org/jira/browse/SPARK-44640
Project: Spark
Issue Type: Sub-task
Components: PySpark
Affects Versions: 3.5.0
Reporter: Allison Wang
When the return type of a UDTF is not an iterable, the error message can be
confusing to users. For example for this UDTF:
{code:java}
@udtf(returnType="x: int")
class TestUDTF:
def eval(self, a):
return a {code}
Currently it fails with this error for regular UDTFs:
return tuple(map(verify_and_convert_result, res))
TypeError: 'int' object is not iterable
And this error for arrow-optimized UDTFs:
raise ValueError("DataFrame constructor not properly called!")
ValueError: DataFrame constructor not properly called!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]