Interface IndexedTable
- All Superinterfaces:
AutoCloseable,Closeable,ReferenceCountedObjectProvider<Closeable>
- All Known Implementing Classes:
BroadcastSegmentIndexedTable,FrameBasedIndexedTable,ReferenceCountedIndexedTableProvider,RowBasedIndexedTable
An interface to a table where some columns (the 'key columns') have indexes that enable fast lookups.
The main user of this class is
IndexedTableJoinable, and its main purpose is to participate in joins.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceIndexes support fast lookups on key columns.static interfaceReaders support reading values out of any column. -
Method Summary
Modifier and TypeMethodDescriptioncolumnIndex(int column) Returns the index for a particular column.columnReader(int column) Returns a reader for a particular column.default byte[]Computes abyte[]key for the table that can be used for computing cache keys for join operations.default booleanReturns whether this indexed table can be cached for the join operationsReturns the columns of this table that have indexes.default ColumnSelectorFactorymakeColumnSelectorFactory(ReadableOffset offset, Closer closer) This method allows a table to directly provide an optimizedColumnSelectorFactoryforIndexedTableJoinMatcherto create selectors.intnumRows()Returns the number of rows in this table.Returns the signature of this table, which includes all key columns (as well as other columns that can be selected, but are not keys).version()Returns the version of this table, used to compare against when loading a new version of the tableMethods inherited from interface org.apache.druid.segment.ReferenceCountedObjectProvider
acquireReference
-
Method Details
-
version
String version()Returns the version of this table, used to compare against when loading a new version of the table -
keyColumns
Returns the columns of this table that have indexes. -
rowSignature
RowSignature rowSignature()Returns the signature of this table, which includes all key columns (as well as other columns that can be selected, but are not keys). -
numRows
int numRows()Returns the number of rows in this table. It must not change over time, since it is used for things like algorithm selection and reporting of cardinality metadata. -
columnIndex
Returns the index for a particular column. The provided column number must be that column's position inrowSignature(). -
columnReader
Returns a reader for a particular column. The provided column number must be that column's position inrowSignature(). Don't forget to close yourIndexedTable.Readerwhen finished reading, to clean up any resources. -
makeColumnSelectorFactory
@Nullable default ColumnSelectorFactory makeColumnSelectorFactory(ReadableOffset offset, Closer closer) This method allows a table to directly provide an optimizedColumnSelectorFactoryforIndexedTableJoinMatcherto create selectors. If this method returns null, the defaultIndexedTableColumnSelectorFactory, which createsIndexedTableDimensionSelectororIndexedTableColumnValueSelectoras appropriate, both backed with acolumnReader(int), will be used instead. -
computeCacheKey
default byte[] computeCacheKey()Computes abyte[]key for the table that can be used for computing cache keys for join operations. seeJoinableFactory.computeJoinCacheKey(org.apache.druid.query.DataSource, org.apache.druid.segment.join.JoinConditionAnalysis)- Returns:
- the byte array for cache key
-
isCacheable
default boolean isCacheable()Returns whether this indexed table can be cached for the join operations
-