Class LookupJoinable
java.lang.Object
org.apache.druid.segment.join.lookup.LookupJoinable
- All Implemented Interfaces:
Joinable,ReferenceCountedObjectProvider<Closeable>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.druid.segment.join.Joinable
Joinable.ColumnValuesWithUniqueFlag -
Field Summary
Fields inherited from interface org.apache.druid.segment.join.Joinable
CARDINALITY_UNKNOWN -
Method Summary
Modifier and TypeMethodDescriptionThis method increments a reference count and provides aCloseablethat decrements the reference count when closed.Returns the list of columns that this Joinable offers.intgetCardinality(String columnName) Returns the cardinality of "columnName", orJoinable.CARDINALITY_UNKNOWNif not known.getColumnCapabilities(String columnName) Returns capabilities for one of this Joinable's columns.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.getMatchableColumnValues(String columnName, boolean includeNull, int maxNumValues) Returns all matchable values from a particular column along with a flag to tell if they are all unique in the column.makeJoinMatcher(ColumnSelectorFactory leftSelectorFactory, JoinConditionAnalysis condition, boolean remainderNeeded, Closer closer) Creates a JoinMatcher that can be used to implement a join onto this Joinable.static LookupJoinablewrap(LookupExtractor extractor)
-
Method Details
-
wrap
-
getAvailableColumns
Description copied from interface:JoinableReturns the list of columns that this Joinable offers.- Specified by:
getAvailableColumnsin interfaceJoinable
-
getCardinality
Description copied from interface:JoinableReturns the cardinality of "columnName", orJoinable.CARDINALITY_UNKNOWNif not known. May be used at query time to trigger optimizations. If notJoinable.CARDINALITY_UNKNOWN, this must match the cardinality of selectors returned by theColumnSelectorFactory.makeDimensionSelector(org.apache.druid.query.dimension.DimensionSpec)method of this joinable'sJoinMatcher.getColumnSelectorFactory().- Specified by:
getCardinalityin interfaceJoinable
-
getColumnCapabilities
Description copied from interface:JoinableReturns capabilities for one of this Joinable's columns.- Specified by:
getColumnCapabilitiesin interfaceJoinable- Parameters:
columnName- column name- Returns:
- capabilities, or null if the columnName is not one of this Joinable's columns
-
makeJoinMatcher
public JoinMatcher makeJoinMatcher(ColumnSelectorFactory leftSelectorFactory, JoinConditionAnalysis condition, boolean remainderNeeded, Closer closer) Description copied from interface:JoinableCreates a JoinMatcher that can be used to implement a join onto this Joinable.- Specified by:
makeJoinMatcherin interfaceJoinable- Parameters:
leftSelectorFactory- column selector factory that allows access to the left-hand side of the joincondition- join condition for the matcherremainderNeeded- whether or notJoinMatcher.matchRemainder()will ever be called on the matcher. If we know it will not, additional optimizations are often possible.closer- closer that will run after join cursor has completed to clean up any per query resources the joinable uses- Returns:
- the matcher
-
getMatchableColumnValues
public Joinable.ColumnValuesWithUniqueFlag getMatchableColumnValues(String columnName, boolean includeNull, int maxNumValues) Description copied from interface:JoinableReturns all matchable values from a particular column along with a flag to tell if they are all unique in the column. If the matchable values are greater than "maxNumValues" or if the column doesn't exists or doesn't supports this operation, returns an object with empty set for column values and false for uniqueness flag. The uniqueness flag will only be true if we've collected all matchable values in the column and found that they're all unique. In all other cases it will be false. The returned set may be passed toInDimFilter. For efficiency, implementations should prefer creating the returned set withnew TreeSet<String>(Comparators.naturalNullsFirst()}. This avoids a copy in the filter's constructor.- Specified by:
getMatchableColumnValuesin interfaceJoinable- Parameters:
columnName- name of the columnincludeNull- whether null should be considered a matchable value. If true, this method returns all values that are present in the column. If false, this method returns all non-null values.maxNumValues- maximum number of values to return. If exceeded, returns an empty set with the "allUnique" flag set to false.
-
acquireReference
Description copied from interface:ReferenceCountedObjectProviderThis method increments a reference count and provides aCloseablethat decrements the reference count when closed. The object returned by this method may or may not be thread-safe, it is best to check with the implementation.IMPORTANT NOTE: to fulfill the contract of this method, implementors must return a closeable to indicate that the reference can be acquired, even if there is nothing to close. Implementors should ideally avoid allowing this method to throw exceptions, but callers are responsible for closing the returned object should any operations on it throw exceptions.
For callers: if this method returns non-empty, IT MUST BE CLOSED, else reference counts can potentially leak.
- Specified by:
acquireReferencein interfaceReferenceCountedObjectProvider<Closeable>
-