Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49275][SQL] Fix return type nullness of the xpath expression
### What changes were proposed in this pull request? 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. Closes apache#47796 from chenhao-db/fix_xpath_nullness. Authored-by: Chenhao Li <[email protected]> Signed-off-by: Max Gekk <[email protected]>
- Loading branch information