You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xi...@apache.org on 2025/08/11 08:12:14 UTC

(pinot) branch master updated: Making LIKE predicate case in-sensitive. (#16568)

This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new fd7a5ab2242 Making LIKE predicate case in-sensitive. (#16568)
fd7a5ab2242 is described below

commit fd7a5ab2242b3fd12841262c82eeb0b4fbed1acf
Author: RAGHVENDRA KUMAR YADAV <ra...@gmail.com>
AuthorDate: Mon Aug 11 01:12:09 2025 -0700

    Making LIKE predicate case in-sensitive. (#16568)
---
 .../pinot/common/function/scalar/regexp/RegexpLikeConstFunctions.java | 2 +-
 .../pinot/common/function/scalar/regexp/RegexpLikeVarFunctions.java   | 2 +-
 .../org/apache/pinot/common/request/context/RequestContextUtils.java  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/regexp/RegexpLikeConstFunctions.java b/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/regexp/RegexpLikeConstFunctions.java
index 80571cdcb41..ac20a543442 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/regexp/RegexpLikeConstFunctions.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/regexp/RegexpLikeConstFunctions.java
@@ -54,7 +54,7 @@ public class RegexpLikeConstFunctions {
   public boolean like(String inputStr, String likePatternStr) {
     if (_matcher == null) {
       String regexPatternStr = RegexpPatternConverterUtils.likeToRegexpLike(likePatternStr);
-      _matcher = PatternFactory.compile(regexPatternStr).matcher("");
+      _matcher = PatternFactory.compile(regexPatternStr, true).matcher("");
     }
 
     return _matcher.reset(inputStr).find();
diff --git a/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/regexp/RegexpLikeVarFunctions.java b/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/regexp/RegexpLikeVarFunctions.java
index 7788559c028..de6f29fbef1 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/regexp/RegexpLikeVarFunctions.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/regexp/RegexpLikeVarFunctions.java
@@ -45,6 +45,6 @@ public class RegexpLikeVarFunctions {
   @ScalarFunction
   public static boolean likeVar(String inputStr, String likePatternStr) {
     String regexPatternStr = RegexpPatternConverterUtils.likeToRegexpLike(likePatternStr);
-    return regexpLikeVar(inputStr, regexPatternStr);
+    return PatternFactory.compile(regexPatternStr, true).matcher(inputStr).find(); // Case insensitive by default
   }
 }
diff --git a/pinot-common/src/main/java/org/apache/pinot/common/request/context/RequestContextUtils.java b/pinot-common/src/main/java/org/apache/pinot/common/request/context/RequestContextUtils.java
index f4bd9b4c00a..4517b1f43d0 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/request/context/RequestContextUtils.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/request/context/RequestContextUtils.java
@@ -242,7 +242,7 @@ public class RequestContextUtils {
 
       case LIKE:
         return FilterContext.forPredicate(new RegexpLikePredicate(getExpression(operands.get(0)),
-            RegexpPatternConverterUtils.likeToRegexpLike(getStringValue(operands.get(1)))));
+            RegexpPatternConverterUtils.likeToRegexpLike(getStringValue(operands.get(1))), "i"));
       case TEXT_CONTAINS:
         return FilterContext.forPredicate(
             new TextContainsPredicate(getExpression(operands.get(0)), getStringValue(operands.get(1))));
@@ -418,7 +418,7 @@ public class RequestContextUtils {
         }
       case LIKE:
         return FilterContext.forPredicate(new RegexpLikePredicate(operands.get(0),
-            RegexpPatternConverterUtils.likeToRegexpLike(getStringValue(operands.get(1)))));
+            RegexpPatternConverterUtils.likeToRegexpLike(getStringValue(operands.get(1))), "i"));
       case TEXT_CONTAINS:
         return FilterContext.forPredicate(new TextContainsPredicate(operands.get(0), getStringValue(operands.get(1))));
       case TEXT_MATCH:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org