deniskuzZ commented on PR #4998:
URL: https://github.com/apache/hive/pull/4998#issuecomment-2059693201
> @deniskuzZ This is original and I don't know why multiple matcher
factories are needed. As you opinion, one factory should be no problem. So, I
fixed.
👍 nice,
1 last thing, I forgot to post it, could we please override `format` method
per enum
````
private enum UDFLikePattern {
BEGIN(BeginChecker.class) {
@Override
String format(String pattern) {
return pattern.substring(0, pattern.length() - 1);
}
},
END(EndChecker.class) {
@Override
String format(String pattern) {
return pattern.substring(1);
}
},
MIDDLE(MiddleChecker.class) {
@Override
String format(String pattern) {
return pattern.substring(1, pattern.length() - 1);
}
},
COMPLEX(ComplexChecker.class) {
@Override
String format(String pattern) {
return "^" + UDFLike.likePatternToRegExp(pattern) + "$";
}
},
CHAINED(ChainedChecker.class),
NONE(NoneChecker.class);
Class<? extends Checker> checker;
UDFLikePattern(Class<? extends Checker> checker) {
this.checker = checker;
}
String format(String pattern) {
return pattern;
}
````
--
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]