Interface IndexCollection
- All Superinterfaces:
Iterable<IndexDescriptor>
- All Known Implementing Classes:
AbstractIndexCollection
,DrillIndexCollection
Interface used to describe an index collection
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Types of an index collections: NATIVE_SECONDARY_INDEX_COLLECTION, EXTERNAL_SECONDARY_INDEX_COLLECTION -
Method Summary
Modifier and TypeMethodDescriptionboolean
addIndex
(IndexDescriptor index) Add a new index to the collection.void
clearAll()
Clears all entries from this index collectionIf this IndexCollection exposes a single GroupScan, return the GroupScan instance.Get the type of this index based onIndexCollection.IndexCollectionType
double
getRows
(org.apache.calcite.rex.RexNode indexCondition) Get the estimated row count for a single index conditionboolean
isColumnIndexed
(SchemaPath path) Check if the field name is the leading key of any of the indexes in this collectionboolean
removeIndex
(IndexDescriptor index) Remove an index (identified by table name and index name) from the collection.boolean
Whether or not the index supports full-text search (to allow pushing down such filters)boolean
Whether or not this index collection supports index selection (selecting an appropriate index out of multiple candidates).boolean
Whether or not the index supports getting row count statisticsMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
addIndex
Add a new index to the collection. Return True if index was successfully added; False otherwise -
removeIndex
Remove an index (identified by table name and index name) from the collection. Return True if index was successfully removed; False otherwise -
clearAll
void clearAll()Clears all entries from this index collection -
getIndexCollectionType
IndexCollection.IndexCollectionType getIndexCollectionType()Get the type of this index based onIndexCollection.IndexCollectionType
- Returns:
- one of the values in
IndexCollection.IndexCollectionType
-
supportsIndexSelection
boolean supportsIndexSelection()Whether or not this index collection supports index selection (selecting an appropriate index out of multiple candidates). Typically, external index collections such as Elasticsearch already have this capability while native secondary index collection may not have - in such cases, Drill needs to do the index selection. -
getRows
double getRows(org.apache.calcite.rex.RexNode indexCondition) Get the estimated row count for a single index condition- Parameters:
indexCondition
- The index condition (e.g index_col1 < 10 AND index_col2 = 'abc')- Returns:
- The estimated row count
-
supportsRowCountStats
boolean supportsRowCountStats()Whether or not the index supports getting row count statistics- Returns:
- True if index supports getting row count, False otherwise
-
supportsFullTextSearch
boolean supportsFullTextSearch()Whether or not the index supports full-text search (to allow pushing down such filters)- Returns:
- True if index supports full-text search, False otherwise
-
getGroupScan
IndexGroupScan getGroupScan()If this IndexCollection exposes a single GroupScan, return the GroupScan instance. For external indexes such as Elasticsearch, we may have a single GroupScan representing all the indexes contained within that collection. On the other hand, for native indexes, each separate index would have its own GroupScan.- Returns:
- GroupScan for this IndexCollection if available, otherwise null
-
isColumnIndexed
Check if the field name is the leading key of any of the indexes in this collection- Parameters:
path
-- Returns:
- True if an appropriate index is found, False otherwise
-