walterddr commented on code in PR #11274:
URL: https://github.com/apache/pinot/pull/11274#discussion_r1285114302


##########
pinot-query-planner/src/main/java/org/apache/calcite/sql/fun/PinotOperatorTable.java:
##########
@@ -115,25 +109,207 @@ public final void initNoDuplicate() {
     //   2. register special handling that differs from calcite standard.
     for (TransformFunctionType transformFunctionType : 
TransformFunctionType.values()) {
       if (transformFunctionType.getSqlKind() != null) {
+        Set<String> registeredFunctionNames = new HashSet<>();
+        String transformFunctionTypeName = transformFunctionType.getName();
         // 1. Register the aggregation function with Calcite
-        registerTransformFunction(transformFunctionType.getName(), 
transformFunctionType);
+        registerTransformFunction(transformFunctionTypeName, 
transformFunctionType);
+        registeredFunctionNames.add(transformFunctionTypeName.toUpperCase());
+
         // 2. Register the aggregation function with Calcite on all 
alternative names
         List<String> alternativeFunctionNames = 
transformFunctionType.getAlternativeNames();
         for (String alternativeFunctionName : alternativeFunctionNames) {
+          if 
(registeredFunctionNames.contains(alternativeFunctionName.toUpperCase())) {
+            continue;
+          }
           registerTransformFunction(alternativeFunctionName, 
transformFunctionType);
+          registeredFunctionNames.add(alternativeFunctionName.toUpperCase());
         }
       }
     }
   }
 
+  private void initPinotOverrideSql() {
+    register(new PinotSqlCoalesceFunction());
+  }
+
+  private void initCalciteStandardSql() {

Review Comment:
   Good idea. 



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