Sergey Nuyanzin created FLINK-41383:
---------------------------------------
Summary: REGEXP, REGEXP_EXTRACT and REGEXP_REPLACE look up a
constant pattern for every row
Key: FLINK-41383
URL: https://issues.apache.org/jira/browse/FLINK-41383
Project: Flink
Issue Type: Technical Debt
Components: Table SQL / Runtime
Reporter: Sergey Nuyanzin
Assignee: Sergey Nuyanzin
These functions get their regex pattern from a cache. They do this for every
row, even when the pattern is a constant in the query.
The cache keeps only 64 patterns per thread. All regex functions share it. If a
query uses more patterns, they push each other out. The patterns are then
compiled again and again while the job runs.
see
-
https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/ThreadLocalCache.java#L35
-
https://github.com/apache/flink/blob/master/flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L71
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)