Package org.apache.druid.math.expr
Class ExprMacroTable.BaseMacroFunctionExpr
java.lang.Object
org.apache.druid.math.expr.ExprMacroTable.BaseMacroFunctionExpr
- All Implemented Interfaces:
Cacheable,Expr,ExprMacroTable.ExprMacroFunctionExpr
- Direct Known Subclasses:
ExprMacroTable.BaseScalarMacroFunctionExpr
- Enclosing class:
ExprMacroTable
public abstract static class ExprMacroTable.BaseMacroFunctionExpr
extends Object
implements ExprMacroTable.ExprMacroFunctionExpr
Base class for
Expr from ExprMacroTable.ExprMacro.-
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
FieldsFields inherited from interface org.apache.druid.math.expr.Expr
ARG_JOINER, NULL_LITERAL -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseMacroFunctionExpr(ExprMacroTable.ExprMacro macro, List<Expr> macroArgs) Constructor for subclasses. -
Method Summary
Modifier and TypeMethodDescription<T> ExprVectorProcessor<T> Builds a 'vectorized' expression processor, that can operate on batches of input values for use in vectorized query engines.booleancanVectorize(Expr.InputBindingInspector inspector) Check if an expression can be 'vectorized', for a given set of inputs.booleangetArgs()inthashCode()Convert theExprback into parseable string that when parsed withParser.parse(String, ExprMacroTable)will produce an equivalentExpr.protected abstract Expr.BindingAnalysisImplemented by subclasses to provide the value foranalyzeInputs(), which uses a memoized supplier.toString()visit(Expr.Shuttle shuttle) Programatically rewrite theExprtree with aExpr.Shuttle.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.druid.math.expr.Expr
asBitmapColumnIndex, asColumnIndexSupplier, asSingleThreaded, decorateCacheKeyBuilder, eval, getBindingIfIdentifier, getCacheKey, getIdentifierExprIfIdentifierExpr, getIdentifierIfIdentifier, getLiteralValue, getOutputType, isIdentifier, isLiteral, isNullLiteral
-
Field Details
-
macro
-
args
-
-
Constructor Details
-
BaseMacroFunctionExpr
Constructor for subclasses.- Parameters:
macro- macro that created this exprmacroArgs- original args to the macro (not the ones this will be evaled with)
-
-
Method Details
-
getArgs
- Specified by:
getArgsin interfaceExprMacroTable.ExprMacroFunctionExpr
-
stringify
Description copied from interface:ExprConvert theExprback into parseable string that when parsed withParser.parse(String, ExprMacroTable)will produce an equivalentExpr. -
visit
Description copied from interface:ExprProgramatically rewrite theExprtree with aExpr.Shuttle. EachExpris responsible for ensuring theExpr.Shuttlecan visit all of itsExprchildren, as well as updating its childrenExprwith 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. -
analyzeInputs
Description copied from interface:Expr- Specified by:
analyzeInputsin interfaceExpr
-
canVectorize
Description copied from interface:ExprCheck 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 aExprVectorProcessorwhich can evaluate values in batches to use with vectorized query engines.- Specified by:
canVectorizein interfaceExpr- Parameters:
inspector-
-
asVectorProcessor
Description copied from interface:ExprBuilds a 'vectorized' expression processor, that can operate on batches of input values for use in vectorized query engines.- Specified by:
asVectorProcessorin interfaceExpr- Parameters:
inspector-
-
supplyAnalyzeInputs
Implemented by subclasses to provide the value foranalyzeInputs(), which uses a memoized supplier. -
equals
-
hashCode
public int hashCode() -
toString
-