Package org.apache.druid.segment.virtual
Class ExpressionPlan
- java.lang.Object
-
- org.apache.druid.segment.virtual.ExpressionPlan
-
public class ExpressionPlan extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExpressionPlan.Trait
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
any(ExpressionPlan.Trait... flags)
Returns true if any of the supplied traits are true in this planExpr.BindingAnalysis
getAnalysis()
Returns basic analysis of the inputs to anExpr
and how they are usedExpr
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.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.Expr
getExpression()
Gets the original expression that was plannedExpressionType
getOutputType()
The output type of the original expression.String
getSingleInputName()
If and only if the expression has a single input, get the name of that inputColumnType
getSingleInputType()
If and only if the column has a single input, get theValueType
of that inputSet<String>
getUnknownInputs()
Get set of inputs which were completely missing information, possibly a non-existent column or from a column selector factory with incomplete informationColumnCapabilities
inferColumnCapabilities(ColumnType outputTypeHint)
Tries to construct the most appropriateColumnCapabilities
for this plan given theoutputType
andtraits
inferred by theExpressionPlanner
, optionally with the help of hintValueType
.boolean
is(ExpressionPlan.Trait... flags)
Returns true if all of the supplied traits are true in this planboolean
isConstant()
An expression with no inputs is a constant
-
-
-
Method Detail
-
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.
-
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.
-
getOutputType
@Nullable public ExpressionType getOutputType()
The output type of the original expression. Note that this might not be the true for the expressions provided bygetAppliedExpression()
orgetAppliedFoldExpression(String)
, should the expression have any unapplied inputs
-
getSingleInputType
@Nullable public ColumnType getSingleInputType()
If and only if the column has a single input, get theValueType
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 anExpr
and how they are used- See Also:
Expr.BindingAnalysis
-
inferColumnCapabilities
@Nullable public ColumnCapabilities inferColumnCapabilities(@Nullable ColumnType outputTypeHint)
Tries to construct the most appropriateColumnCapabilities
for this plan given theoutputType
andtraits
inferred by theExpressionPlanner
, optionally with the help of hintValueType
. 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
-
-