Package org.apache.druid.segment.join
Class JoinableClause
java.lang.Object
org.apache.druid.segment.join.JoinableClause
- All Implemented Interfaces:
ReferenceCountedObjectProvider<Closeable>
Represents everything about a join clause except for the left-hand datasource. In other words, if the full join
clause is "t1 JOIN t2 ON t1.x = t2.x" then this class represents "JOIN t2 ON x = t2.x" -- it does not include
references to the left-hand "t1".
Created from PreJoinableClause.
-
Constructor Summary
ConstructorsConstructorDescriptionJoinableClause(String prefix, Joinable joinable, JoinType joinType, JoinConditionAnalysis condition) -
Method Summary
Modifier and TypeMethodDescriptionThis method increments a reference count and provides aCloseablethat decrements the reference count when closed.booleanReturns a list of columns from the underlyingJoinable.getAvailableColumns()method, with our prefix (getPrefix()) prepended.The join condition.The right-hand Joinable.The type of join: LEFT, RIGHT, INNER, or FULL.The prefix to apply to all columns from the Joinable.inthashCode()booleanincludesColumn(String columnName) Returns whether "columnName" can be retrieved from theJoinablerepresented by this clause (i.e., whether it starts withprefixand has at least one other character beyond that).toString()Removes our prefix from "columnName".
-
Constructor Details
-
JoinableClause
public JoinableClause(String prefix, Joinable joinable, JoinType joinType, JoinConditionAnalysis condition)
-
-
Method Details
-
getPrefix
The prefix to apply to all columns from the Joinable. The idea is that during a join, any columns that start with this prefix should be retrieved from our Joinable'sJoinMatcher.getColumnSelectorFactory(). Any other columns should be returned from the left-hand side of the join. The prefix can be any string, as long as it is nonempty and not itself a prefix of the reserved column name__time.- See Also:
-
getJoinable
The right-hand Joinable. -
getJoinType
The type of join: LEFT, RIGHT, INNER, or FULL. -
getCondition
The join condition. When referring to right-hand columns, it should include the prefix. -
getAvailableColumnsPrefixed
Returns a list of columns from the underlyingJoinable.getAvailableColumns()method, with our prefix (getPrefix()) prepended. -
includesColumn
Returns whether "columnName" can be retrieved from theJoinablerepresented by this clause (i.e., whether it starts withprefixand has at least one other character beyond that). -
unprefix
Removes our prefix from "columnName". Must only be called ifincludesColumn(java.lang.String)would have returned true on this column name. -
equals
-
hashCode
public int hashCode() -
toString
-
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>
-