Ritesh17rb opened a new pull request, #397:
URL: https://github.com/apache/datafusion-spark/pull/397
## Which issue does this PR close?
Closes #205.
## Rationale for this change
DataFusion's `substring_index` alias searches non-overlapping delimiters.
Spark counts overlaps, so `substring_index('||||||', '|||', 3)` should return
`||` rather than the whole string.
## What changes are included in this PR?
- Register a Spark implementation for UTF8_BINARY matching, using shared
input coercion with an INT count.
- Search overlapping occurrences from either direction; preserve the source
string layout and input nullability.
- Match NULL, empty delimiter, count boundary and Unicode behavior,
including Spark's INT_MIN error without panicking.
- Add SQL coverage and generate the function reference.
Other collations are outside this PR, as allowed by the issue. Implicit cast
execution still depends on #88; the three known legacy count-cast differences
are marked explicitly in the SQL tests.
## Are these changes tested?
`string/substring_index.slt` covers both execution modes, every
scalar/column combination, overlaps, Unicode, NULLs, boundaries, dictionaries
and Arrow string layouts. A unit test checks return type and nullability. The
Spark 4.2.0 runner reports 86 passes, three expected CAST differences tracked
by #88, and five runner-specific skips.
Formatting, workspace Clippy, 596 library tests, five documentation tests,
all 516 SQL test runs and documentation generation pass.
## Are there any user-facing changes?
`substring_index` now counts overlapping delimiters like Spark under
UTF8_BINARY.
--
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]