[ https://issues.apache.org/jira/browse/HIVE-26047?focusedWorklogId=746464&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-746464 ]
ASF GitHub Bot logged work on HIVE-26047: ----------------------------------------- Author: ASF GitHub Bot Created on: 23/Mar/22 10:09 Start Date: 23/Mar/22 10:09 Worklog Time Spent: 10m Work Description: zabetak commented on pull request #3117: URL: https://github.com/apache/hive/pull/3117#issuecomment-1076183992 If I understand well the problem may appear when a certain `LIKE` pattern is relatively big. Most, if not all, of the supported patterns can be identified with a linear complexity algorithm. Identifying the type of pattern using regular expressions (`java.util.regex.Pattern` or `com.google.re2j.Pattern`), although convenient, can hardly become more efficient than a custom algorithm. If we want to avoid the performance hit of JDK-8203458 for the specific case of `LIKE` patterns then going for custom implementation should be the way to go. -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 746464) Time Spent: 0.5h (was: 20m) > Vectorized LIKE UDF should use Re2J regex to address JDK-8203458 > ---------------------------------------------------------------- > > Key: HIVE-26047 > URL: https://issues.apache.org/jira/browse/HIVE-26047 > Project: Hive > Issue Type: Bug > Reporter: Naresh P R > Assignee: Naresh P R > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > Below pattern is taking a long time to validate regex in java8 with same > trace as shown in java bug > [JDK-8203458|https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8203458] > > {code:java} > import java.util.regex.Pattern; > public class Test { > public static void main(String args[]) { > String pattern = > "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_b"; > > Pattern CHAIN_PATTERN = Pattern.compile("(%?[^%_\\\\]+%?)+"); > CHAIN_PATTERN.matcher(pattern).matches(); > } > } > {code} > Same is reproducible with following SQL > {code:java} > create table table1(name string); > insert into table1 (name) values > ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_b'); > select * from table1 where name like > "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_b";{code} -- This message was sent by Atlassian Jira (v8.20.1#820001)