Package org.apache.druid.segment.join
Class HashJoinSegment
- java.lang.Object
-
- org.apache.druid.segment.join.HashJoinSegment
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ReferenceCountedObject,Segment,SegmentReference
public class HashJoinSegment extends Object implements SegmentReference
Represents a deep, left-heavy join of a left-hand side baseSegment onto a series of right-hand side clauses.In other words, logically the operation is: join(join(join(baseSegment, clauses[0]), clauses[1]), clauses[2]) etc.
-
-
Constructor Summary
Constructors Constructor Description HashJoinSegment(SegmentReference baseSegment, Filter baseFilter, List<JoinableClause> clauses, JoinFilterPreAnalysis joinFilterPreAnalysis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Closeable>acquireReferences()This method is expected to increment a reference count and provide aCloseablethat decrements the reference count when closed.<T> Tas(Class<T> clazz)Request an implementation of a particular interface.QueryableIndexasQueryableIndex()StorageAdapterasStorageAdapter()voidclose()org.joda.time.IntervalgetDataInterval()SegmentIdgetId()
-
-
-
Constructor Detail
-
HashJoinSegment
public HashJoinSegment(SegmentReference baseSegment, @Nullable Filter baseFilter, List<JoinableClause> clauses, JoinFilterPreAnalysis joinFilterPreAnalysis)
- Parameters:
baseSegment- The left-hand side base segmentclauses- The right-hand side clauses. The caller is responsible for ensuring that there are no duplicate prefixes or prefixes that shadow each other across the clausesjoinFilterPreAnalysis- Pre-analysis for the query we expect to run on this segment
-
-
Method Detail
-
getDataInterval
public org.joda.time.Interval getDataInterval()
- Specified by:
getDataIntervalin interfaceSegment
-
asQueryableIndex
@Nullable public QueryableIndex asQueryableIndex()
- Specified by:
asQueryableIndexin interfaceSegment
-
asStorageAdapter
public StorageAdapter asStorageAdapter()
- Specified by:
asStorageAdapterin interfaceSegment
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
acquireReferences
public Optional<Closeable> acquireReferences()
Description copied from interface:ReferenceCountedObjectThis method is expected to increment a reference count and provide aCloseablethat decrements the reference count when closed. This is likely just a wrapper aroundReferenceCountingCloseableObject.incrementReferenceAndDecrementOnceCloseable(), but may also include any other associated references which should be incremented when this method is called, and decremented/released by the closeable. 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 avoid allowing this method or theCloseableit creates to throw exceptions. For callers: if this method returns non-empty, IT MUST BE CLOSED, else reference counts can potentially leak.- Specified by:
acquireReferencesin interfaceReferenceCountedObject
-
as
public <T> T as(Class<T> clazz)
Description copied from interface:SegmentRequest an implementation of a particular interface. If the passed-in interface isQueryableIndexorStorageAdapter, then this method behaves identically toSegment.asQueryableIndex()orSegment.asStorageAdapter(). Other interfaces are only expected to be requested by callers that have specific knowledge of extra features provided by specific segment types. For example, an extension might provide a custom Segment type that can offer both StorageAdapter and some new interface. That extension can also offer a Query that uses that new interface. Implementations which accept classes other thanQueryableIndexorStorageAdapterare limited to using those classes within the extension. This means that one extension cannot rely on the `Segment.as` behavior of another extension.
-
-