All Implemented Interfaces:
NamedWriteable, Writeable, PostAnalysisVerificationAware, Resolvable, SortAgnostic
Direct Known Subclasses:
InlineJoin, LookupJoin

public class Join extends BinaryPlan implements PostAnalysisVerificationAware, SortAgnostic
  • Field Details

  • Constructor Details

  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • getWriteableName

      public String getWriteableName()
      Specified by:
      getWriteableName in interface NamedWriteable
    • config

      public JoinConfig config()
    • info

      protected NodeInfo<Join> info()
      Specified by:
      info in class Node<LogicalPlan>
    • output

      public List<Attribute> output()
      Description copied from class: QueryPlan
      The ordered list of attributes (i.e. columns) this plan produces when executed. Must be called only on resolved plans, otherwise may throw an exception or return wrong results.
      Specified by:
      output in class QueryPlan<LogicalPlan>
    • leftReferences

      public AttributeSet leftReferences()
      Specified by:
      leftReferences in class BinaryPlan
    • rightReferences

      public AttributeSet rightReferences()
      Specified by:
      rightReferences in class BinaryPlan
    • rightOutputFields

      public List<Attribute> rightOutputFields()
      The output fields obtained from the right child.
    • computeOutput

      public static List<Attribute> computeOutput(List<Attribute> leftOutput, List<Attribute> rightOutput, JoinConfig config)
      Combine the two lists of attributes into one. In case of (name) conflicts, specify which sides wins, that is overrides the other column - the left or the right.
    • makeReference

      public static List<Attribute> makeReference(List<Attribute> output)
      Make fields references, so we don't check if they exist in the index. We do this for fields that we know don't come from the index.

      It's important that name is returned as a *reference* here instead of a field. If it were a field we'd use SearchStats on it and discover that it doesn't exist in the index. It doesn't! We don't expect it to. It exists only in the lookup table. TODO we should rework stats so we don't have to do this

    • expressionsResolved

      public boolean expressionsResolved()
      Specified by:
      expressionsResolved in class LogicalPlan
    • resolved

      public boolean resolved()
      Specified by:
      resolved in interface Resolvable
      Overrides:
      resolved in class LogicalPlan
    • withConfig

      public Join withConfig(JoinConfig config)
    • replaceChildren

      public Join replaceChildren(LogicalPlan left, LogicalPlan right)
      Specified by:
      replaceChildren in class BinaryPlan
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BinaryPlan
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class BinaryPlan
    • postAnalysisVerification

      public void postAnalysisVerification(Failures failures)
      Description copied from interface: PostAnalysisVerificationAware
      Allows the implementer to validate itself. This usually involves checking its internal setup, which often means checking the parameters it received on construction: their data or syntactic type, class, their count, expressions' structure etc. The discovered failures are added to the given Failures object.

      It is often more useful to perform the checks as extended as it makes sense, over stopping at the first failure. This will allow the author to progress faster to a correct query.

      Example: the Filter class, which models the WHERE command, checks that the expression it filters on - condition - is of a Boolean or NULL type:

           
           @Override
           void postAnalysisVerification(Failures failures) {
                if (condition.dataType() != NULL && condition.dataType() != BOOLEAN) {
                    failures.add(fail(condition, "Condition expression needs to be boolean, found [{}]", condition.dataType()));
                }
           }
           
           
      Specified by:
      postAnalysisVerification in interface PostAnalysisVerificationAware
      Parameters:
      failures - the object to add failures to.