Class TimestampFloorExprMacro.TimestampFloorExpr
- java.lang.Object
-
- org.apache.druid.math.expr.ExprMacroTable.BaseScalarMacroFunctionExpr
-
- org.apache.druid.query.expression.TimestampFloorExprMacro.TimestampFloorExpr
-
- All Implemented Interfaces:
Cacheable
,Expr
,ExprMacroTable.ExprMacroFunctionExpr
- Enclosing class:
- TimestampFloorExprMacro
public static class TimestampFloorExprMacro.TimestampFloorExpr extends ExprMacroTable.BaseScalarMacroFunctionExpr
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.druid.math.expr.Expr
Expr.BindingAnalysis, Expr.InputBindingInspector, Expr.ObjectBinding, Expr.Shuttle, Expr.VectorInputBinding, Expr.VectorInputBindingInspector
-
-
Field Summary
-
Fields inherited from class org.apache.druid.math.expr.ExprMacroTable.BaseScalarMacroFunctionExpr
args, name
-
Fields inherited from interface org.apache.druid.math.expr.Expr
ARG_JOINER, NULL_LITERAL
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ExprVectorProcessor<T>
asVectorProcessor(Expr.VectorInputBindingInspector inspector)
Builds a 'vectorized' expression processor, that can operate on batches of input values for use in vectorized query engines.boolean
canVectorize(Expr.InputBindingInspector inspector)
Check if an expression can be 'vectorized', for a given set of inputs.boolean
equals(Object o)
ExprEval
eval(Expr.ObjectBinding bindings)
Expr
getArg()
Exposed for Druid SQL: this is used by Expressions.toQueryGranularity.PeriodGranularity
getGranularity()
Exposed for Druid SQL: this is used by Expressions.toQueryGranularity.ExpressionType
getOutputType(Expr.InputBindingInspector inspector)
Given anExpr.InputBindingInspector
, compute what the outputExpressionType
will be for this expression.int
hashCode()
Expr
visit(Expr.Shuttle shuttle)
Programatically rewrite theExpr
tree with aExpr.Shuttle
.-
Methods inherited from class org.apache.druid.math.expr.ExprMacroTable.BaseScalarMacroFunctionExpr
analyzeInputs, getArgs, stringify, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.druid.math.expr.Expr
decorateCacheKeyBuilder, getBindingIfIdentifier, getCacheKey, getIdentifierExprIfIdentifierExpr, getIdentifierIfIdentifier, getLiteralValue, isIdentifier, isLiteral, isNullLiteral
-
-
-
-
Method Detail
-
getArg
public Expr getArg()
Exposed for Druid SQL: this is used by Expressions.toQueryGranularity.
-
getGranularity
public PeriodGranularity getGranularity()
Exposed for Druid SQL: this is used by Expressions.toQueryGranularity.
-
eval
@Nonnull public ExprEval eval(Expr.ObjectBinding bindings)
Description copied from interface:Expr
-
visit
public Expr visit(Expr.Shuttle shuttle)
Description copied from interface:Expr
Programatically rewrite theExpr
tree with aExpr.Shuttle
. EachExpr
is responsible for ensuring theExpr.Shuttle
can visit all of itsExpr
children, as well as updating its childrenExpr
with the results from theExpr.Shuttle
, before finally visiting an updated form of itself. When this Expr is the result ofExprMacroTable.ExprMacro.apply(java.util.List<org.apache.druid.math.expr.Expr>)
, all of the original arguments to the macro must be visited, including arguments that may have been "baked in" to this Expr.
-
getOutputType
@Nullable public ExpressionType getOutputType(Expr.InputBindingInspector inspector)
Description copied from interface:Expr
Given anExpr.InputBindingInspector
, compute what the outputExpressionType
will be for this expression. In the vectorized expression engine, ifExpr.canVectorize(InputBindingInspector)
returns true, a return value of null MUST ONLY indicate that the expression has all null inputs (non-existent columns) or null constants for the entire expression. Otherwise, all vectorizable expressions must produce an output type to correctly operate with the vectorized engine. Outside the context of vectorized expressions, a return value of null can also indicate that the given type information was not enough to resolve the output type, so the expression must be evaluated using defaultExpr.eval(org.apache.druid.math.expr.Expr.ObjectBinding)
handling where types are only known after evaluation, throughExprEval.type()
, such as transform expressions at ingestion time
-
canVectorize
public boolean canVectorize(Expr.InputBindingInspector inspector)
Description copied from interface:Expr
Check if an expression can be 'vectorized', for a given set of inputs. If this method returns true,Expr.asVectorProcessor(org.apache.druid.math.expr.Expr.VectorInputBindingInspector)
is expected to produce aExprVectorProcessor
which can evaluate values in batches to use with vectorized query engines.
-
asVectorProcessor
public <T> ExprVectorProcessor<T> asVectorProcessor(Expr.VectorInputBindingInspector inspector)
Description copied from interface:Expr
Builds a 'vectorized' expression processor, that can operate on batches of input values for use in vectorized query engines.
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classExprMacroTable.BaseScalarMacroFunctionExpr
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classExprMacroTable.BaseScalarMacroFunctionExpr
-
-