ryukobayashi commented on code in PR #4998:
URL: https://github.com/apache/hive/pull/4998#discussion_r1540348976
##########
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:
@deniskuzZ Sorry for the late reply as I was unwell. This algorithm is not
directly implemented by me, but with a few modifications. It's already
implemented in a UDF that runs when Vectorized is off. So I don't know if there
are any benchmarks to prove its efficiency:
https://github.com/apache/hive/blob/release-4.0.0-rc0/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFLike.java#L108-L158
--
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]