yikf opened a new pull request, #12697:
URL: https://github.com/apache/gluten/pull/12697
<!--
Thank you for submitting a pull request! Here are some tips:
1. For first-time contributors, please read our contributing guide:
https://github.com/apache/gluten/blob/main/CONTRIBUTING.md
2. If necessary, create a GitHub issue for discussion beforehand to avoid
duplicate work.
3. If the PR is specific to a single backend, include [VL] or [CH] in the PR
title to indicate the
Velox or ClickHouse backend, respectively.
4. If the PR is not ready for review, please mark it as a draft.
-->
## What changes are proposed in this pull request?
Wire up the Spark `regexp_instr` function for the Velox backend. Velox
already registers `regexp_instr(string, pattern)` with Spark-compatible
semantics, so this is Gluten-side plumbing only:
- Map RegExpInStr in the spark34/35/40/41 shims (the expression doesn't
exist in Spark 3.3); the converter matches it by class name so gluten-substrait
still builds on 3.3.
- Drop the idx child: Spark's RegExpInStr ignores it (always returns the
whole-match start), while Velox's regexp_instr is 2-arg.
- Add regexp_instr to the native validator's kRegexFunctions so
non-constant / RE2-incompatible patterns fall back to Spark.
- Blacklist it for the ClickHouse backend (native support not verified
there).
- Update the function-support doc.
<!--
Provide a clear and concise description of the changes introduced in this PR.
Ensure the PR description aligns with the code changes, especially after
updates.
If applicable, include "Fixes #<GitHub_Issue_ID>" to automatically close the
corresponding issue
when the PR is merged.
-->
## How was this patch tested?
<!--
Describe how the changes were tested, if applicable.
Include new tests to validate the functionality, if necessary.
For UI-related changes, attach screenshots to demonstrate the updates.
-->
Added regexp_instr cases in ScalarFunctionsValidateSuite (compares Gluten vs
vanilla Spark):
1. 2-arg form
2. no-match (returns 0)
3. 3-arg form, and a 3-arg case where the group's start differs from the
whole match to guard against future idx divergence.
## Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this
patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
Yes, AI-assisted, Generated-by: Claude claude-opus-4-8.
--
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]