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



##########
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:
       This is widely considered an antipattern because it creates a new class 
for each map this is done for. Doing this in a static block or using a factory 
method doesn’t add much code but doesn’t increase the number of class files, 
classes to load etc.




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