comphead opened a new pull request, #23928:
URL: https://github.com/apache/datafusion/pull/23928
## Rationale for this change
Spark's `elt` errors on out-of-range indices when ANSI is on, and returns
`NULL` when off. DataFusion previously always returned `NULL` (there was a
`TODO` for this in the source).
## What changes are included in this PR?
- `elt.rs`: read `enable_ansi_mode` from
`ScalarFunctionArgs::config_options`; raise `"The index N is out of bounds. The
array has M elements."` in ANSI mode, keep `NULL` behavior otherwise. `NULL`
index
always returns `NULL`.
- `elt.slt`: add missing ANSI-off cases (index 0, negative, large, `NULL`
index, `NULL` value, vectorized) and a full ANSI-on section with `statement
error` assertions.
## Are these changes tested?
Yes. New Rust unit tests and sqllogictest cases cover both modes.
## Are there any user-facing changes?
With `enable_ansi_mode = true`, `elt` on invalid indices now errors
instead of returning `NULL`. Default behavior unchanged. No API changes.
--
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]