Aravind-Suresh commented on code in PR #10897:
URL: https://github.com/apache/pinot/pull/10897#discussion_r1228992428
##########
pinot-common/src/main/java/org/apache/pinot/common/utils/RegexpPatternConverterUtils.java:
##########
@@ -64,24 +71,42 @@ public static String likeToRegexpLike(String likePattern) {
break;
}
- String escaped = escapeMetaCharacters(likePattern.substring(start, end));
- StringBuilder sb = new StringBuilder(escaped.length() + 2);
+ likePattern = likePattern.substring(start, end);
+ StringBuilder sb = new StringBuilder();
sb.append(prefix);
- sb.append(escaped);
- sb.append(suffix);
+ // handling SQL wildcards by replacing them with corresponding regex
equivalents
+ // we ignore them if the SQL wildcards are escaped
int i = 0;
- while (i < sb.length()) {
- char c = sb.charAt(i);
+ boolean isPrevCharBackSlash = false;
+ while (i < likePattern.length()) {
+ char c = likePattern.charAt(i);
if (c == '_') {
- sb.replace(i, i + 1, ".");
Review Comment:
I've replaced the ones (BACK_SLASH) which occur more than once here. Rest
I've left for readability.
--
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]