jackylee-ch opened a new pull request, #47268:
URL: https://github.com/apache/spark/pull/47268

   ### What changes were proposed in this pull request?
   This pr is trying to fix the syntax issues with GenericUDF since 3.5.1. The 
problem arose from DeferredObject currently passing a value instead of a 
function, which prevented users from catching exceptions in GenericUDF, 
resulting in semantic differences.
   
   Here is an example case we encountered. Originally, the semantics were that 
udf_exception would throw an exception, while udf_catch_exception could catch 
the exception and return a null value. However, currently, any exception 
encountered by udf_exception will cause the program to fail.
   ```
   select udf_catch_exception(udf_exception(col1)) from table
   ```
   
   ### Why are the changes needed?
   For codegen mode, we would run the children's code first. If an exception is 
thrown, we would make it lazy to GenericUDF's DeferredObject.
   For non-codegen mode, we would directly make the GenericUDF's DeferredObject 
lazy.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   Newly added UT.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.


-- 
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