Hyukjin Kwon created SPARK-61003:
------------------------------------

             Summary: Register UDTFs on the server with spark.udtf.register of 
the Python client as PySpark does
                 Key: SPARK-61003
                 URL: https://issues.apache.org/jira/browse/SPARK-61003
             Project: Spark
          Issue Type: Bug
          Components: Connect
    Affects Versions: connect-rust-4.3.0
            Reporter: Hyukjin Kwon


In PySpark Connect, {{spark.udtf.register(name, f)}} registers the UDTF {{f}} 
under {{name}} on the server, with a {{register_table_function}} command of its 
{{CommonInlineUserDefinedTableFunction}} (its handler, return type, eval type 
and determinism), so that SQL can call it: {{spark.sql("SELECT * FROM 
name(2)")}}. It raises {{CANNOT_REGISTER_UDTF}} for an {{f}} that is not a 
UDTF, and {{INVALID_UDTF_EVAL_TYPE}} for one of another eval type.

The Rust-backed Python client only renames the UDTF object, so the server does 
not know the name: for a registered UDTF, {{spark.sql("SELECT * FROM 
name(2)")}} raises {{UNRESOLVABLE_TABLE_VALUED_FUNCTION}} where PySpark 4.3.0 
returns its rows. It also takes a handler class rather than a UDTF. Register 
UDTFs 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]

Reply via email to