richardstartin commented on a change in pull request #8137:
URL: https://github.com/apache/pinot/pull/8137#discussion_r801114043



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/function/TransformFunctionType.java
##########
@@ -101,12 +107,28 @@
   // Geo indexing
   GEOTOH3("geoToH3");
 
+  private static final Set<String> NAMES = Arrays.stream(values())
+      .flatMap(func -> Stream.of(func.getName(), func.getName().replace("_", 
"").toUpperCase(),
+          func.getName().toUpperCase(), func.getName().toLowerCase(), 
func.name(), func.name().toLowerCase()))
+      .collect(Collectors.toSet());
+
   private final String _name;
 
   TransformFunctionType(String name) {
     _name = name;
   }
 
+  public static boolean isTransformFunction(String functionName) {
+    if (NAMES.contains(functionName)) {
+      return true;
+    }
+    // scalar functions
+    if (FunctionRegistry.containsFunction(functionName)) {
+      return true;
+    }
+    return NAMES.contains(functionName.toUpperCase().replace("_", ""));

Review comment:
       It looks like `StringUtils.remove` is quite a lot faster on JDK11 when 
there are characters to remove, but allocates a little bit more, I will change 
this back.




-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to