deniskuzZ commented on code in PR #4998:
URL: https://github.com/apache/hive/pull/4998#discussion_r1533870472


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FilterStringColLikeStringScalar.java:
##########
@@ -140,4 +133,84 @@ public Checker tryCreate(String pattern) {
       return new ComplexChecker("^" + UDFLike.likePatternToRegExp(pattern) + 
"$");
     }
   }
+
+  /**
+   * Check the LIKE pattern..
+   */
+  private static class CheckerPattern {
+    private final String pattern;
+    private final UDFLike.PatternType type;
+
+    public CheckerPattern(UDFLike.PatternType type, String pattern) {
+      this.type = type;
+      this.pattern = pattern;
+    }
+
+    public String check() {
+      UDFLike.PatternType lastType = UDFLike.PatternType.NONE;
+      int length = pattern.length();
+      int beginIndex = 0;
+      int endIndex = length;
+      char lastChar = 0;
+      String strPattern = new String();
+      String simplePattern;
+
+      for (int i = 0; i < length; i++) {

Review Comment:
   @ryukobayashi, are you saying that your code with char matching is more 
efficient than regex?  
   Could you please create a benchmark (JMH) and share the results?
   cc @zabetak, since you were involved in 
[HIVE-26047](https://issues.apache.org/jira/browse/HIVE-26047)



-- 
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]

Reply via email to