fix: Add custom nullability for Spark ILIKE function #19206
+84
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #19174
This PR adds custom nullability handling for the Spark ILIKE function. Previously, the function was using the default
is_nullablewhich always returnstrue, which is not correct.Changes
return_field_from_args()to handle custom nullability logicILIKE(NULL, pattern)orILIKE(str, NULL)returnsNULLreturn_type()to useinternal_err!pattern to enforce use ofreturn_field_from_argsTest Plan
All existing tests pass:
running 2 tests test function::string::ilike::tests::test_ilike_nullability ... ok test function::string::ilike::tests::test_ilike_invoke ... ok test result: ok. 2 passed; 0 failed; 0 ignored
The implementation follows the same pattern used by other Spark functions in the codebase (like
shuffleandarray)