Jackie-Jiang commented on code in PR #16276:
URL: https://github.com/apache/pinot/pull/16276#discussion_r2191109465


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/regexp/RegexpLikeCiVarFunctions.java:
##########
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.common.function.scalar.regexp;
+
+import java.util.regex.Pattern;
+import org.apache.pinot.spi.annotations.ScalarFunction;
+
+
+/**
+ * Case-insensitive regexp_like implementation for variable pattern.
+ */
+public class RegexpLikeCiVarFunctions {
+  private RegexpLikeCiVarFunctions() {
+  }
+
+  /**
+   * Returns true if the input string matches the given regular expression 
(case-insensitive, variable pattern).
+   */
+  @ScalarFunction
+  public static boolean regexpLikeCiVar(String inputStr, String 
regexPatternStr) {
+    Pattern pattern = Pattern.compile(regexPatternStr, Pattern.UNICODE_CASE | 
Pattern.CASE_INSENSITIVE);

Review Comment:
   Seems like the original one is already case insensitive?



##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/regexp/RegexpLikeCiConstFunctions.java:
##########
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.common.function.scalar.regexp;
+
+import org.apache.pinot.common.utils.regex.Matcher;
+import org.apache.pinot.common.utils.regex.PatternFactory;
+import org.apache.pinot.spi.annotations.ScalarFunction;
+
+
+/**
+ * Case-insensitive regexp_like implementation for constant pattern.
+ */
+public class RegexpLikeCiConstFunctions {

Review Comment:
   Here is the doc for `REGEXP_LIKE`:
   https://docs.oracle.com/cd/B14117_01/server.101/b10759/conditions018.htm
   
   It takes an optional third argument as the `match_parameter`. We can follow 
the same behavior



##########
pinot-common/src/main/java/org/apache/pinot/common/utils/regex/JavaUtilPattern.java:
##########
@@ -20,12 +20,17 @@
 
 import java.util.regex.Pattern;
 
-
 public class JavaUtilPattern implements 
org.apache.pinot.common.utils.regex.Pattern {
   Pattern _pattern;
 
   public JavaUtilPattern(String regex) {
-    _pattern = Pattern.compile(regex, Pattern.UNICODE_CASE | 
Pattern.CASE_INSENSITIVE);

Review Comment:
   Are we doing case insensitive match now without `FST`? If so, we are already 
having inconsistent behavior right?



-- 
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]

Reply via email to