xinrong-meng opened a new pull request, #39860:
URL: https://github.com/apache/spark/pull/39860

   TODO:
   
   - [ ] code cleanup for `spark.register_udf`
   - [ ] rename CommonInlineUserDefinedFunction to CommonUserDefinedFunction
   - [ ] unit tests
   - [ ] docstrings
   
   ### What changes were proposed in this pull request?
   Standardize registered pickled Python UDFs, specifically, implement 
`spark.udf.register()`.
   
   ```py
   >>> spark.udf
   <pyspark.sql.connect.udf.UDFRegistration object at 0x7fbca0077dc0>
   >>> f = spark.udf.register("f", lambda x: x+1, "int")
   >>> f
   <function <lambda> at 0x7fbc905e5e50>
   >>> spark.sql("SELECT f(id) FROM range(2)").collect()
   [Row(f(id)=1), Row(f(id)=2)] 
   ```
   
   ### Why are the changes needed?
   To reach parity with vanilla PySpark.
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. `spark.register_udf` is removed, whereas `spark.udf.register()` is 
added.
   
   
   ### How was this patch tested?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to