Class ExpressionPlan

java.lang.Object
org.apache.druid.segment.virtual.ExpressionPlan

public class ExpressionPlan extends Object
  • Method Details

    • isConstant

      public boolean isConstant()
      An expression with no inputs is a constant
    • getExpression

      public Expr getExpression()
      Gets the original expression that was planned
    • getAppliedExpression

      public Expr getAppliedExpression()
      If an expression uses a multi-valued input in a scalar manner, the expression can be automatically transformed to map these values across the expression, applying the original expression to every value.
      See Also:
    • getAppliedFoldExpression

      public Expr getAppliedFoldExpression(String accumulatorId)
      If an expression uses a multi-valued input in a scalar manner, and the expression contains an accumulator such as for use as part of an aggregator, the expression can be automatically transformed to fold the accumulator across the values of the original expression.
      See Also:
    • getOutputType

      @Nullable public ExpressionType getOutputType()
      The output type of the original expression. Note that this might not be the true for the expressions provided by getAppliedExpression() or getAppliedFoldExpression(String), should the expression have any unapplied inputs
    • getSingleInputType

      @Nullable public ColumnType getSingleInputType()
      If and only if the column has a single input, get the ValueType of that input
    • getSingleInputName

      public String getSingleInputName()
      If and only if the expression has a single input, get the name of that input
    • getUnknownInputs

      public Set<String> getUnknownInputs()
      Get set of inputs which were completely missing information, possibly a non-existent column or from a column selector factory with incomplete information
    • getAnalysis

      public Expr.BindingAnalysis getAnalysis()
      Returns basic analysis of the inputs to an Expr and how they are used
      See Also:
    • inferColumnCapabilities

      @Nullable public ColumnCapabilities inferColumnCapabilities(@Nullable ColumnType outputTypeHint)
      Tries to construct the most appropriate ColumnCapabilities for this plan given the outputType and traits inferred by the ExpressionPlanner, optionally with the help of hint ValueType. If no output type was able to be inferred during planning, returns null
    • is

      public boolean is(ExpressionPlan.Trait... flags)
      Returns true if all of the supplied traits are true in this plan
    • any

      public boolean any(ExpressionPlan.Trait... flags)
      Returns true if any of the supplied traits are true in this plan