clintropolis commented on code in PR #12388:
URL: https://github.com/apache/druid/pull/12388#discussion_r847959408
##########
processing/src/main/java/org/apache/druid/query/filter/ColumnIndexSelector.java:
##########
@@ -19,33 +19,33 @@
package org.apache.druid.query.filter;
-import com.google.errorprone.annotations.MustBeClosed;
import org.apache.druid.collections.bitmap.BitmapFactory;
-import org.apache.druid.collections.bitmap.ImmutableBitmap;
-import org.apache.druid.collections.spatial.ImmutableRTree;
import org.apache.druid.segment.ColumnInspector;
-import org.apache.druid.segment.column.BitmapIndex;
-import org.apache.druid.segment.column.ColumnCapabilities;
-import org.apache.druid.segment.data.CloseableIndexed;
+import org.apache.druid.segment.column.ColumnIndexCapabilities;
import javax.annotation.Nullable;
/**
*/
-public interface BitmapIndexSelector extends ColumnInspector
+public interface ColumnIndexSelector extends ColumnInspector
{
- @MustBeClosed
- @Nullable
- CloseableIndexed<String> getDimensionValues(String dimension);
-
- @Deprecated
- ColumnCapabilities.Capable hasMultipleValues(String dimension);
-
int getNumRows();
+
BitmapFactory getBitmapFactory();
+
+ /**
+ * Get the {@link ColumnIndexCapabilities} of a column for the specified
type of index. If the index does not exist
+ * this method will return null. Note that 'missing' columns should in fact
return a non-null value from this method
+ * to allow for filters to use 'nil' bitmaps if the filter matches nulls, in
order to produce an all true or all
+ * false index.
+ */
@Nullable
- BitmapIndex getBitmapIndex(String dimension);
+ <T> ColumnIndexCapabilities getIndexCapabilities(String column, Class<T>
clazz);
+
+ /**
+ * Get the specified type of index for the specified column. {@link
#getIndexCapabilities(String, Class)} should
+ * be called prior to this method to distinguish 'missing' columns from
columns without indexes.
+ */
@Nullable
- ImmutableBitmap getBitmapIndex(String dimension, String value);
- ImmutableRTree getSpatialIndex(String dimension);
+ <T> T as(String column, Class<T> clazz);
Review Comment:
I think `FilterBundle` is going to be a bit more complex than you're hoping,
which is part of why I didn't try to consolidate `getIndexCapabilities` and
`getIndex` yet. Not all value matchers are predicates, so it can't strictly
operate on predicates, and value matchers need the cursor created from the
offset of the 'pre' part of the filter bundle to actually be created, so it
might be a factory that can make value matchers to use as a post-filter.
--
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]