You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Sergey Nuyanzin (Jira)" <ji...@apache.org> on 2026/05/12 16:25:00 UTC
[jira] [Commented] (FLINK-39649) REGEXP_EXTRACT plan-time validation and hot-path log cleanup
[ https://issues.apache.org/jira/browse/FLINK-39649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18080392#comment-18080392 ]
Sergey Nuyanzin commented on FLINK-39649:
-----------------------------------------
Merged as [aa079c5bab96ef96e92d5b70afa6b4e052ef0e78|https://github.com/apache/flink/commit/aa079c5bab96ef96e92d5b70afa6b4e052ef0e78]
> REGEXP_EXTRACT plan-time validation and hot-path log cleanup
> ------------------------------------------------------------
>
> Key: FLINK-39649
> URL: https://issues.apache.org/jira/browse/FLINK-39649
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API, Table SQL / Planner, Table SQL / Runtime
> Reporter: Ramin Gharib
> Priority: Major
> Labels: pull-request-available
>
> SqlFunctionUtils.regexpExtract compiles the regex per record and emits LOG.error on PatternSyntaxException. The pattern is known at planning time when it is a string literal.
> h3. Reproducer
>
> {code:java}
> SELECT REGEXP_EXTRACT(payload, '(', 1) FROM src; {code}
>
> '(' is an unbalanced group. The job plans successfully and the runtime emits one stack trace per record processed.
> h3.
> Fix
> # Add RegexpExtractInputTypeStrategy. Compiles literal regex during inferInputTypes, fails via callContext.fail(...).
> # Route BuiltInFunctionDefinitions.REGEXP_EXTRACT through it
> # Update SqlFunctionUtils.regexpExtract to use REGEXP_PATTERN_CACHE and silently return null on compile failure. No LOG.error on the hot path.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)