LuciferYang opened a new issue, #13476:
URL: https://github.com/apache/gluten/issues/13476
On the Velox backend, a regex whose character class contains `&&` returns a
different result than vanilla Spark. Java reads `&&` inside a class as set
intersection, while RE2 reads it as two literal `&` characters. For example,
`'a' RLIKE '[a&&d]'` is true in Gluten, because RE2 sees the class `{a, &, d}`,
and false in vanilla Spark, because the intersection of `{a}` and `{d}` is
empty. `regexp_extract(s, '[a-z&&l-p]', 0)` returns the first lowercase letter
or `&` in Gluten, but only a letter between `l` and `p` in vanilla Spark.
`ensureRegexIsCompatible` in the native validator already rejects nested
classes such as `[a[b]]` and `[a&&[b]]`, so those fall back. The bare form
`[a&&b]`, which is the usual way to write an intersection, passes the check. A
class that starts with `[^]` has the same gap: the check ends the class at that
`]`, while Java and RE2 both read it as a class member, so `[^]&&x]` also
passes.
The check runs for constant patterns of `rlike`, `regexp_extract`,
`regexp_extract_all`, `regexp_replace`, `regexp_instr` and `split`, and nothing
else screens these patterns with the default configuration.
This issue was written with the assistance of AI (Claude Opus).
--
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]