Class HashJoinSegment

java.lang.Object
org.apache.druid.segment.join.HashJoinSegment
All Implemented Interfaces:
Closeable, AutoCloseable, Segment

public class HashJoinSegment extends Object implements Segment
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 Details

    • HashJoinSegment

      public HashJoinSegment(Segment baseSegment, @Nullable Filter baseFilter, List<JoinableClause> clauses, JoinFilterPreAnalysis joinFilterPreAnalysis, Closeable referenceCloseable)
      Parameters:
      baseSegment - The left-hand side base segment
      baseFilter - Filter for left-hand side base segment
      clauses - 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 clauses
      joinFilterPreAnalysis - Pre-analysis for the query we expect to run on this segment
      referenceCloseable - Closeables for the right-hand side clauses
  • Method Details

    • getId

      public SegmentId getId()
      Description copied from interface: Segment
      Returns the SegmentId of this segment, if it is backed by a real table, otherwise returns null.
      Specified by:
      getId in interface Segment
    • getDataInterval

      public org.joda.time.Interval getDataInterval()
      Specified by:
      getDataInterval in interface Segment
    • as

      public <T> T as(Class<T> clazz)
      Description copied from interface: Segment
      Request an implementation of a particular interface.

      All implementations of this method should be able to provide a CursorFactory. 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 CursorFactory and some new interface. That extension can also offer a Query that uses that new interface.

      Implementations which accept classes other than known built-in interfaces such as CursorFactory are limited to using those classes within the extension. This means that one extension cannot rely on the `Segment.as` behavior of another extension.

      Specified by:
      as in interface Segment
      Type Parameters:
      T - desired interface
      Parameters:
      clazz - desired interface
      Returns:
      instance of clazz, or null if the interface is not supported by this segment, one of the following:
    • validateOrElseThrow

      public void validateOrElseThrow(PolicyEnforcer policyEnforcer)
      Description copied from interface: Segment
      Validates if the segment complies with the policy restrictions on tables.

      This should be called right before the segment is about to be processed by the query stack, and after ExecutionVertex.createSegmentMapFunction(PolicyEnforcer).

      Specified by:
      validateOrElseThrow in interface Segment
    • getDebugString

      public String getDebugString()
      Description copied from interface: Segment
      Developer friendly string suitable to use in internal error messages and provide some additional information about what kind of segment was involved in a problem
      Specified by:
      getDebugString in interface Segment
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException