You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/03/13 02:16:28 UTC

[GitHub] [pinot] Jackie-Jiang commented on a change in pull request #8341: Canonicalize the function name for SQL parser

Jackie-Jiang commented on a change in pull request #8341:
URL: https://github.com/apache/pinot/pull/8341#discussion_r825375678



##########
File path: pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
##########
@@ -757,6 +757,23 @@ private static Expression compileFunctionExpression(SqlBasicCall functionNode) {
     }
   }
 
+  private static final Map<String, FilterKind> CANONICAL_NAME_TO_FILTER_KIND_MAP = new HashMap<String, FilterKind>() {{
+    for (FilterKind filterKind : FilterKind.values()) {
+      put(StringUtils.remove(filterKind.name(), '_'), filterKind);
+    }
+  }};

Review comment:
       Good point, didn't know that.
   Here is an article explaining why this is an anti-pattern: https://blog.jooq.org/dont-be-clever-the-double-curly-braces-anti-pattern




-- 
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-unsubscribe@pinot.apache.org

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



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