Package org.apache.druid.math.expr
Class ExprMacroTable
- java.lang.Object
-
- org.apache.druid.math.expr.ExprMacroTable
-
- Direct Known Subclasses:
GuiceExprMacroTable
public class ExprMacroTable extends Object
Mechanism by which Druid expressions can define new functions for the Druid expression language. WhenExprListenerImplis creating aFunctionExpr,ExprMacroTablewill first be checked to find the function by name, falling back toParser.getFunction(String)to map to a built-inFunctionif none is defined in the macro table.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExprMacroTable.BaseScalarMacroFunctionExprBase class for multi-argumentExprMacroTable.ExprMacrofunctionExprstatic classExprMacroTable.BaseScalarUnivariateMacroFunctionExprBase class for single argumentExprMacroTable.ExprMacrofunctionExprstatic interfaceExprMacroTable.ExprMacrostatic interfaceExprMacroTable.ExprMacroFunctionExprstub interface to allowParser.flatten(Expr)a way to recognize macro functions that exend this
-
Constructor Summary
Constructors Constructor Description ExprMacroTable(List<ExprMacroTable.ExprMacro> macros)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Exprget(String functionName, List<Expr> args)Returns an expr corresponding to a function call if this table has an entry forfunctionName.List<ExprMacroTable.ExprMacro>getMacros()static ExprMacroTablenil()
-
-
-
Constructor Detail
-
ExprMacroTable
public ExprMacroTable(List<ExprMacroTable.ExprMacro> macros)
-
-
Method Detail
-
nil
public static ExprMacroTable nil()
-
getMacros
public List<ExprMacroTable.ExprMacro> getMacros()
-
get
@Nullable public Expr get(String functionName, List<Expr> args)
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
-
-