[ 
https://issues.apache.org/jira/browse/FLINK-41383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18141288#comment-18141288
 ] 

Sergey Nuyanzin commented on FLINK-41383:
-----------------------------------------

Merged as 
[fc2568fb9884e66538a51f83e5e861669b511969|https://github.com/apache/flink/commit/fc2568fb9884e66538a51f83e5e861669b511969]

>  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
>            Priority: Major
>              Labels: pull-request-available
>
> 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)

Reply via email to