gortiz commented on code in PR #8893:
URL: https://github.com/apache/pinot/pull/8893#discussion_r913450592
##########
pinot-common/src/main/java/org/apache/pinot/common/utils/RegexpPatternConverterUtils.java:
##########
@@ -33,7 +33,49 @@ private RegexpPatternConverterUtils() {
* Converts a LIKE pattern into REGEXP_LIKE pattern.
*/
public static String likeToRegexpLike(String likePattern) {
- return "^" + escapeMetaCharacters(likePattern).replace('_',
'.').replace("%", ".*") + "$";
+ int start = 0;
+ int end = likePattern.length();
+ String prefix = "^";
+ String suffix = "$";
+ switch (likePattern.length()) {
+ case 0:
+ return "^$";
+ case 1:
+ if (likePattern.charAt(0) == '%') {
+ return "^.*$";
Review Comment:
All three are correct. I guess the later is the most efficient
--
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]