imply-cheddar commented on code in PR #12388:
URL: https://github.com/apache/druid/pull/12388#discussion_r847955690
##########
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:
For the capabilities, what I was suggesting is, e.g. where
LexicographicRangeIndex has method
```
default Iterable<ImmutableBitmap> getBitmapsInRange(
@Nullable String startValue,
boolean startStrict,
@Nullable String endValue,
boolean endStrict
)
```
It could have signature
```
default FilterBundle getBitmapsInRange(
@Nullable String startValue,
boolean startStrict,
@Nullable String endValue,
boolean endStrict
)
```
Where `FilterBundle` would be a new class that could have fields for bitmap
indexes, value predicates, selectivity estimation, whether it's safe to invert,
etc. etc. Which, I believe meets the need that you are highlighting for
`ColumnIndexCapabilities`.
--
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]