Interface IndexDefinition

All Known Subinterfaces:
IndexDescriptor
All Known Implementing Classes:
AbstractIndexDescriptor, DrillIndexDefinition, DrillIndexDescriptor

public interface IndexDefinition
Top level interface used to define an index.
  • Method Details

    • getIndexColumnOrdinal

      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
      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

      boolean isCoveringIndex(List<LogicalExpression> columns)
      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

      boolean allColumnsIndexed(Collection<LogicalExpression> columns)
      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

      boolean someColumnsIndexed(Collection<LogicalExpression> columns)
      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

      Get the type of this index based on IndexDefinition.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