Package org.apache.druid.math.expr
Class ExprMacroTable
java.lang.Object
org.apache.druid.math.expr.ExprMacroTable
- Direct Known Subclasses:
GuiceExprMacroTable
Mechanism by which Druid expressions can define new functions for the Druid expression language. When
ExprListenerImpl is creating a FunctionExpr, ExprMacroTable will first be checked to find
the function by name, falling back to Parser.getFunction(String) to map to a built-in Function if
none is defined in the macro table.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBase class forExprfromExprMacroTable.ExprMacro.static classBase class forExprfromExprMacroTable.ExprMacrothat accepts all-scalar arguments.static interfacestatic interfacestub interface to allowParser.flatten(Expr)a way to recognize macro functions that exend this -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an expr corresponding to a function call if this table has an entry forfunctionName.static ExprMacroTableSpecializedExprMacroTablethat only knows aboutTimestampFloorExprMacro, intended for use parsing generated expressions which translateGranularityintoExprstatic ExprMacroTablenil()
-
Constructor Details
-
ExprMacroTable
-
-
Method Details
-
nil
-
granularity
SpecializedExprMacroTablethat only knows aboutTimestampFloorExprMacro, intended for use parsing generated expressions which translateGranularityintoExpr -
getMacros
-
get
Returns an expr corresponding to a function call if this table has an entry forfunctionName. Otherwise, returns null.- Parameters:
functionName- function nameargs- function arguments- Returns:
- expr for this function call, or null
-