richardstartin commented on code in PR #10043:
URL: https://github.com/apache/pinot/pull/10043#discussion_r1065591440
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/filter/RangeIndexBasedFilterOperator.java:
##########
@@ -44,44 +53,74 @@ public class RangeIndexBasedFilterOperator extends
BaseFilterOperator {
private static final String EXPLAIN_NAME = "FILTER_RANGE_INDEX";
- private final RangeEvaluator _rangeEvaluator;
- private final PredicateEvaluator _rangePredicateEvaluator;
+ static final Set<FieldSpec.DataType> SUPPORTED_RAW_DATA_TYPES =
+ EnumSet.of(FieldSpec.DataType.INT, FieldSpec.DataType.LONG,
FieldSpec.DataType.FLOAT, FieldSpec.DataType.DOUBLE);
+
+ private final RangeIndexReader<ImmutableRoaringBitmap> _rangeIndexReader;
+ private final PredicateEvaluator _predicateEvaluator;
private final DataSource _dataSource;
+ private final FieldSpec.DataType _parameterType;
+ private final Object _parameters;
private final int _numDocs;
+ static boolean canEvaluate(PredicateEvaluator predicateEvaluator, DataSource
dataSource) {
+ if (dataSource.getRangeIndex() != null) {
+ boolean datatypeSupported = (predicateEvaluator.isDictionaryBased() ||
SUPPORTED_RAW_DATA_TYPES.contains(
Review Comment:
Self documenting code tends to avoid implicit dependencies like that. This
way, you have a _declaration of requirements_ in one place which reduces
cognitive overhead for the reader. The overhead of these kinds of checks is
also rather small, especially if the method gets inlined and some of the
redundancy at the call site gets removed.
--
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]