public class DrillIndexDefinition extends Object implements IndexDefinition
IndexDefinition.IndexType
Modifier and Type | Field and Description |
---|---|
protected Set<LogicalExpression> |
allIndexColumns |
protected CollationContext |
indexCollationContext |
protected List<LogicalExpression> |
indexColumns
The indexColumns is the list of column(s) on which this index is created.
|
protected String |
indexName
indexName: name of the index that should be unique within the scope of a table
|
protected IndexDefinition.IndexType |
indexType |
protected List<LogicalExpression> |
nonIndexColumns
nonIndexColumns: the list of columns that are included in the index as 'covering'
columns but are not themselves indexed.
|
protected org.apache.calcite.rel.RelFieldCollation.NullDirection |
nullsDirection |
protected List<LogicalExpression> |
rowKeyColumns |
protected String |
tableName |
Constructor and Description |
---|
DrillIndexDefinition(List<LogicalExpression> indexCols,
CollationContext indexCollationContext,
List<LogicalExpression> nonIndexCols,
List<LogicalExpression> rowKeyColumns,
String indexName,
String tableName,
IndexDefinition.IndexType type,
org.apache.calcite.rel.RelFieldCollation.NullDirection nullsDirection) |
Modifier and Type | Method and Description |
---|---|
boolean |
allColumnsIndexed(Collection<LogicalExpression> columns)
Check if this index have all the columns specified in the supplied list of columns indexed
|
protected boolean |
columnsInIndexFields(Collection<LogicalExpression> columns,
Collection<LogicalExpression> indexFields) |
boolean |
equals(Object o) |
org.apache.calcite.rel.RelCollation |
getCollation()
Get the collation property (physical ordering) of the index.
|
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
|
int |
getIndexColumnOrdinal(LogicalExpression path)
Check to see if the field name is an index column and if so return the ordinal position in the index
|
List<LogicalExpression> |
getIndexColumns()
Get the list of columns in the index key.
|
String |
getIndexName()
Get the name of the index
|
IndexDefinition.IndexType |
getIndexType()
Get the type of this index based on
IndexDefinition.IndexType |
List<LogicalExpression> |
getNonIndexColumns()
Get the list of columns that are in the 'included' or 'covered' fields.
|
org.apache.calcite.rel.RelFieldCollation.NullDirection |
getNullsOrderingDirection()
Get the nulls ordering of this index
|
List<LogicalExpression> |
getRowKeyColumns()
Get the list of columns (typically 1 column) that constitute the row key (primary key)
|
String |
getTableName()
Get the name of the table this index is associated with
|
int |
hashCode() |
boolean |
isCoveringIndex(List<LogicalExpression> columns)
Check if this index 'covers' all the columns specified in the supplied list of columns
|
boolean |
pathExactIn(SchemaPath path,
Collection<LogicalExpression> exprs) |
boolean |
someColumnsIndexed(Collection<LogicalExpression> columns)
Check if this index has some columns specified in the supplied list of columns indexed
|
protected boolean |
someColumnsInIndexFields(Collection<LogicalExpression> columns,
Collection<LogicalExpression> indexFields) |
String |
toString() |
protected final List<LogicalExpression> indexColumns
protected final List<LogicalExpression> nonIndexColumns
protected final Set<LogicalExpression> allIndexColumns
protected final List<LogicalExpression> rowKeyColumns
protected final CollationContext indexCollationContext
protected final String indexName
protected final String tableName
protected final IndexDefinition.IndexType indexType
protected final org.apache.calcite.rel.RelFieldCollation.NullDirection nullsDirection
public DrillIndexDefinition(List<LogicalExpression> indexCols, CollationContext indexCollationContext, List<LogicalExpression> nonIndexCols, List<LogicalExpression> rowKeyColumns, String indexName, String tableName, IndexDefinition.IndexType type, org.apache.calcite.rel.RelFieldCollation.NullDirection nullsDirection)
public int getIndexColumnOrdinal(LogicalExpression path)
IndexDefinition
getIndexColumnOrdinal
in interface IndexDefinition
path
- The field path you want to compare to index column names.public boolean isCoveringIndex(List<LogicalExpression> columns)
IndexDefinition
isCoveringIndex
in interface IndexDefinition
public boolean allColumnsIndexed(Collection<LogicalExpression> columns)
IndexDefinition
allColumnsIndexed
in interface IndexDefinition
public boolean someColumnsIndexed(Collection<LogicalExpression> columns)
IndexDefinition
someColumnsIndexed
in interface IndexDefinition
public boolean pathExactIn(SchemaPath path, Collection<LogicalExpression> exprs)
protected boolean columnsInIndexFields(Collection<LogicalExpression> columns, Collection<LogicalExpression> indexFields)
protected boolean someColumnsInIndexFields(Collection<LogicalExpression> columns, Collection<LogicalExpression> indexFields)
public String getIndexName()
IndexDefinition
getIndexName
in interface IndexDefinition
public String getTableName()
IndexDefinition
getTableName
in interface IndexDefinition
public IndexDefinition.IndexType getIndexType()
IndexDefinition
IndexDefinition.IndexType
getIndexType
in interface IndexDefinition
IndexDefinition.IndexType
public List<LogicalExpression> getRowKeyColumns()
IndexDefinition
getRowKeyColumns
in interface IndexDefinition
public List<LogicalExpression> getIndexColumns()
IndexDefinition
getIndexColumns
in interface IndexDefinition
public List<LogicalExpression> getNonIndexColumns()
IndexDefinition
getNonIndexColumns
in interface IndexDefinition
public org.apache.calcite.rel.RelCollation getCollation()
IndexDefinition
getCollation
in interface IndexDefinition
public Map<LogicalExpression,org.apache.calcite.rel.RelFieldCollation> getCollationMap()
IndexDefinition
getCollationMap
in interface IndexDefinition
public org.apache.calcite.rel.RelFieldCollation.NullDirection getNullsOrderingDirection()
IndexDefinition
getNullsOrderingDirection
in interface IndexDefinition
Copyright © 1970 The Apache Software Foundation. All rights reserved.