Hyukjin Kwon created SPARK-61048:
------------------------------------
Summary: Expose the sparkSession of spark.udf, and send the return
type of registerJavaFunction, in the Python client as PySpark does
Key: SPARK-61048
URL: https://issues.apache.org/jira/browse/SPARK-61048
Project: Spark
Issue Type: Bug
Components: Connect
Affects Versions: connect-rust-4.3.0
Reporter: Hyukjin Kwon
In PySpark Connect, {{spark.udf}} is a {{UDFRegistration}} whose
{{sparkSession}} is the session, and {{spark.udf.registerJavaFunction(name,
javaClassName, returnType)}} sends its return type in the {{JavaUDF}} of the
{{RegisterFunction}} command: a DDL string as an unparsed data type, which the
server parses, and a DataType as itself. It raises {{UNSUPPORTED_OPERATION}} of
"data type ..." for a return type that is neither, and sends the function as
not deterministic.
The Rust-backed Python client names the session {{spark_session}}, and parses
the {{simpleString}} of the return type in the client: an invalid DDL string
raises {{INVALID_DATATYPE_FORMAT}} rather than the {{PARSE_SYNTAX_ERROR}} of
the server, and a return type that is not a DataType raises an
{{AttributeError}}. Take them as PySpark does.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]