public interface Joinable extends ReferenceCountedObject
makeJoinMatcher(org.apache.druid.segment.ColumnSelectorFactory, org.apache.druid.segment.join.JoinConditionAnalysis, boolean). Its main user is
HashJoinEngine.makeJoinCursor(org.apache.druid.segment.Cursor, org.apache.druid.segment.join.JoinableClause).| Modifier and Type | Field and Description |
|---|---|
static int |
CARDINALITY_UNKNOWN |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getAvailableColumns()
Returns the list of columns that this Joinable offers.
|
int |
getCardinality(String columnName)
Returns the cardinality of "columnName", or
CARDINALITY_UNKNOWN if not known. |
ColumnCapabilities |
getColumnCapabilities(String columnName)
Returns capabilities for one of this Joinable's columns.
|
Optional<Set<String>> |
getCorrelatedColumnValues(String searchColumnName,
String searchColumnValue,
String retrievalColumnName,
long maxCorrelationSetSize,
boolean allowNonKeyColumnSearch)
Searches a column from this Joinable for a particular value, finds rows that match,
and returns values of a second column for those rows.
|
JoinMatcher |
makeJoinMatcher(ColumnSelectorFactory leftColumnSelectorFactory,
JoinConditionAnalysis condition,
boolean remainderNeeded)
Creates a JoinMatcher that can be used to implement a join onto this Joinable.
|
acquireReferencesstatic final int CARDINALITY_UNKNOWN
List<String> getAvailableColumns()
int getCardinality(String columnName)
CARDINALITY_UNKNOWN if not known. May be used at query
time to trigger optimizations.
If not CARDINALITY_UNKNOWN, this must match the cardinality of selectors returned by the
ColumnSelectorFactory.makeDimensionSelector(org.apache.druid.query.dimension.DimensionSpec) method of this joinable's
JoinMatcher.getColumnSelectorFactory() .@Nullable ColumnCapabilities getColumnCapabilities(String columnName)
columnName - column nameJoinMatcher makeJoinMatcher(ColumnSelectorFactory leftColumnSelectorFactory, JoinConditionAnalysis condition, boolean remainderNeeded)
leftColumnSelectorFactory - column selector factory that allows access to the left-hand side of the joincondition - join condition for the matcherremainderNeeded - whether or not JoinMatcher.matchRemainder() will ever be called on the
matcher. If we know it will not, additional optimizations are often possible.Optional<Set<String>> getCorrelatedColumnValues(String searchColumnName, String searchColumnValue, String retrievalColumnName, long maxCorrelationSetSize, boolean allowNonKeyColumnSearch)
searchColumnName - Name of the search column. This is the column that is being used in the filtersearchColumnValue - Target value of the search column. This is the value that is being filtered on.retrievalColumnName - The column to retrieve values from. This is the column that is being joined against.maxCorrelationSetSize - Maximum number of values to retrieve. If we detect that more values would be
returned than this limit, return an empty set.allowNonKeyColumnSearch - If true, allow searchs on non-key columns. If this is false,
a search on a non-key column should return an empty set.Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.