vvivekiyer commented on code in PR #8518:
URL: https://github.com/apache/pinot/pull/8518#discussion_r863005987
##########
pinot-common/src/main/java/org/apache/pinot/pql/parsers/pql2/ast/FilterKind.java:
##########
@@ -19,33 +19,41 @@
package org.apache.pinot.pql.parsers.pql2.ast;
public enum FilterKind {
- AND,
- OR,
- NOT,
- 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;
+ AND(false, false),
+ OR(false, false),
+ NOT(false, false),
+ EQUALS(true, false),
+ NOT_EQUALS(true, false),
+ GREATER_THAN(true, true),
+ GREATER_THAN_OR_EQUAL(true, true),
+ LESS_THAN(true, true),
+ LESS_THAN_OR_EQUAL(true, true),
+ LIKE(true, false),
+ BETWEEN(true, true),
+ RANGE(true, true),
+ IN(true, false),
+ NOT_IN(true, false),
+ REGEXP_LIKE(true, false),
+ IS_NULL(true, false),
+ IS_NOT_NULL(true, false),
+ TEXT_MATCH(true, false),
+ JSON_MATCH(true, false);
- /**
- * Helper method that returns true if the enum maps to a Range.
- *
- * @return True if the enum is of Range type, false otherwise.
- */
+ private final boolean _isPredicate;
+ private final boolean _isRange;
+
+ FilterKind(boolean isPredicate, boolean isRange) {
+ _isPredicate = isPredicate;
+ _isRange = isRange;
+ }
+
+ /** @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 _isRange;
+ }
+
+ /** @return true if the filter is a predicate. This logic should mimic
FilterContext.Type. */
+ public boolean isPredicate() {
Review Comment:
Please see comment above.
--
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]