vvivekiyer commented on code in PR #8518:
URL: https://github.com/apache/pinot/pull/8518#discussion_r852297396


##########
pinot-common/src/main/java/org/apache/pinot/pql/parsers/pql2/ast/FilterKind.java:
##########
@@ -39,13 +41,26 @@ public enum FilterKind {
   TEXT_MATCH,
   JSON_MATCH;
 
+  private static final EnumSet<FilterKind> RANGE_FILTERS = 
EnumSet.of(GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN,

Review Comment:
   Thanks for pointing this out. Done.



##########
pinot-common/src/main/java/org/apache/pinot/pql/parsers/pql2/ast/FilterKind.java:
##########
@@ -39,13 +41,26 @@ public enum FilterKind {
   TEXT_MATCH,
   JSON_MATCH;
 
+  private static final EnumSet<FilterKind> RANGE_FILTERS = 
EnumSet.of(GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN,
+      LESS_THAN_OR_EQUAL, BETWEEN, RANGE);
+  private static final EnumSet<FilterKind> PREDICATE_FILTERS = 
EnumSet.of(EQUALS, NOT_EQUALS, GREATER_THAN,
+      GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, LIKE, BETWEEN, 
RANGE, IN, NOT_IN, REGEXP_LIKE, IS_NULL,
+      IS_NOT_NULL, TEXT_MATCH, JSON_MATCH);
   /**
    * Helper method that returns true if the enum maps to a Range.
    *
    * @return True if the enum is of Range type, false otherwise.
    */
   public boolean isRange() {
-    return this == GREATER_THAN || this == GREATER_THAN_OR_EQUAL || this == 
LESS_THAN || this == LESS_THAN_OR_EQUAL
-        || this == BETWEEN || this == RANGE;
+    return RANGE_FILTERS.contains(this);
+  }
+
+  /**
+   * Returns true if the filter is a predicate. Returns false otherwise. This 
logic should mimic FilterContext.Type.
+   *
+   * @return where the filter is a predicate.
+   */

Review Comment:
   Done.



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