Interface IndexDefinition
- All Known Subinterfaces:
IndexDescriptor
- All Known Implementing Classes:
AbstractIndexDescriptor
,DrillIndexDefinition
,DrillIndexDescriptor
public interface IndexDefinition
Top level interface used to define an index.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Types of an index: PRIMARY_KEY_INDEX, NATIVE_SECONDARY_INDEX, EXTERNAL_SECONDARY_INDEX -
Method Summary
Modifier and TypeMethodDescriptionboolean
allColumnsIndexed
(Collection<LogicalExpression> columns) Check if this index have all the columns specified in the supplied list of columns indexedorg.apache.calcite.rel.RelCollation
Get the collation property (physical ordering) of the index.Map<LogicalExpression,
org.apache.calcite.rel.RelFieldCollation> Get a mapping of the LogicalExpresion/SchemaPath to its field collation - e.g Ascending/Descending, Nulls First/Nulls Lastint
Check to see if the field name is an index column and if so return the ordinal position in the indexGet the list of columns in the index key.Get the name of the indexGet the type of this index based onIndexDefinition.IndexType
Get the list of columns that are in the 'included' or 'covered' fields.org.apache.calcite.rel.RelFieldCollation.NullDirection
Get the nulls ordering of this indexGet the list of columns (typically 1 column) that constitute the row key (primary key)Get the name of the table this index is associated withboolean
isCoveringIndex
(List<LogicalExpression> columns) Check if this index 'covers' all the columns specified in the supplied list of columnsboolean
someColumnsIndexed
(Collection<LogicalExpression> columns) Check if this index has some columns specified in the supplied list of columns indexed
-
Method Details
-
getIndexColumnOrdinal
Check to see if the field name is an index column and if so return the ordinal position in the index- Parameters:
path
- The field path you want to compare to index column names.- Returns:
- Return ordinal of the indexed column if valid, otherwise return -1
-
getIndexName
String getIndexName()Get the name of the index -
isCoveringIndex
Check if this index 'covers' all the columns specified in the supplied list of columns- Parameters:
columns
-- Returns:
- True for covering index, False for non-covering
-
allColumnsIndexed
Check if this index have all the columns specified in the supplied list of columns indexed- Parameters:
columns
-- Returns:
- True if all fields are indexed, False for some or all fields is not indexed
-
someColumnsIndexed
Check if this index has some columns specified in the supplied list of columns indexed- Parameters:
columns
-- Returns:
- True if some fields are indexed, False if none of the fields are indexed
-
getRowKeyColumns
List<LogicalExpression> getRowKeyColumns()Get the list of columns (typically 1 column) that constitute the row key (primary key)- Returns:
-
getTableName
String getTableName()Get the name of the table this index is associated with -
getIndexType
IndexDefinition.IndexType getIndexType()Get the type of this index based onIndexDefinition.IndexType
- Returns:
- one of the values in
IndexDefinition.IndexType
-
getIndexColumns
List<LogicalExpression> getIndexColumns()Get the list of columns in the index key. -
getNonIndexColumns
List<LogicalExpression> getNonIndexColumns()Get the list of columns that are in the 'included' or 'covered' fields. -
getCollation
org.apache.calcite.rel.RelCollation getCollation()Get the collation property (physical ordering) of the index. -
getCollationMap
Map<LogicalExpression,org.apache.calcite.rel.RelFieldCollation> getCollationMap()Get a mapping of the LogicalExpresion/SchemaPath to its field collation - e.g Ascending/Descending, Nulls First/Nulls Last -
getNullsOrderingDirection
org.apache.calcite.rel.RelFieldCollation.NullDirection getNullsOrderingDirection()Get the nulls ordering of this index- Returns:
- True, if nulls first. False otherwise
-