richardstartin commented on code in PR #8518:
URL: https://github.com/apache/pinot/pull/8518#discussion_r850721889
##########
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:
I would prefer this were solved differently as requested previously:
```java
public enum FilterKind {
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);
private final boolean _isPredicate;
private final boolean _isRange;
FilterKind(boolean isPredicate, boolean isRange) {
_isPredicate = isPredicate;
_isRange = isRange;
}
/**
* 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 _isRange;
}
}
```
this forces the modifier to define whether the new value is a predicate or a
range predicate.
--
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]