chenhao-db opened a new pull request, #47959:
URL: https://github.com/apache/spark/pull/47959

   ### What changes were proposed in this pull request?
   
   This is a cherry-pick of https://github.com/apache/spark/pull/47796.
   
   The `xpath` expression incorrectly marks its return type as array of 
non-null strings. However, it can actually return an array containing nulls. 
This can cause NPE in code generation, such as query `select 
coalesce(xpath(repeat('<a></a>', id), 'a')[0], '') from range(1, 2)`.
   
   ### Why are the changes needed?
   
   It avoids potential failures in queries that uses the `xpath` expression.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   A new unit test. It would fail without the change in the PR.
   
   ### 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