lgbo-ustc opened a new issue, #13607: URL: https://github.com/apache/gluten/issues/13607
## Problem The ClickHouse backend executes Spark/Java regular-expression functions using RE2, but the pattern translation added for `regexp_extract` is local to that parser. `regexp_extract_all`, `rlike`, `regexp_replace`, and regex `split` can interpret the same pattern differently. The existing bracket flattening is heuristic and does not generally preserve Java semantics for intersections, scoped flags, or other unsupported constructs. ## Proposed improvement * Introduce a shared Spark/Java-to-RE2 pattern translator in the CH backend, used by the regex functions above for literal patterns. * Keep replacement-string conversion separate from pattern translation. * Translate supported constructs while preserving capture-group numbering and DOTALL scope; explicitly reject or fall back for unsupported cases instead of silently changing semantics. * Add unit coverage for character classes, escaped brackets, anchors, DOTALL, and capture groups, plus Spark/CH comparison tests. ## Scope and follow-ups Some Java patterns cannot be faithfully implemented by RE2 (e.g. lookaround and backreferences). Other constructs need additional lowering (e.g. intersections and multiline-anchor behavior). The initial implementation should document and test its supported subset, and ensure unsupported cases fall back to Spark. CH native build/CI is needed to verify integration. -- 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]
