public class InputBindings extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
InputBindings.BestEffortInputBindings
Expr.ObjectBinding backed by a cache populated by ExprEval.bestEffortOf(Object) for when the input
type information is totally unknown, for a single row worth of values. |
static class |
InputBindings.InputSupplier<T> |
| Constructor and Description |
|---|
InputBindings() |
| Modifier and Type | Method and Description |
|---|---|
static Expr.ObjectBinding |
forInputSupplier(ExpressionType type,
com.google.common.base.Supplier<?> supplier)
Create a
Expr.ObjectBinding for a single input value of a known type provided by some Supplier |
static Expr.ObjectBinding |
forInputSupplier(String supplierName,
ExpressionType type,
com.google.common.base.Supplier<?> supplier)
Create a
Expr.ObjectBinding for a single input value of a known type provided by some Supplier |
static Expr.ObjectBinding |
forInputSuppliers(Map<String,InputBindings.InputSupplier<?>> bindings)
Create
Expr.ObjectBinding backed by map of Supplier to provide values for identifiers to evaluate
Expr |
static Expr.ObjectBinding |
forMap(Map<String,?> bindings)
Deprecated.
|
static Expr.ObjectBinding |
forMap(Map<String,?> bindings,
Expr.InputBindingInspector inspector)
Create
Expr.ObjectBinding backed by Map to provide values for identifiers to evaluate Expr
Types are detected and values are coereced via ExprEval.bestEffortOf(Object) because input types are
currently unknown. |
static Expr.ObjectBinding |
forRow(Row row)
Creates a
Expr.ObjectBinding backed by some Row. |
static <T> InputBindings.InputSupplier<T> |
inputSupplier(ExpressionType type,
com.google.common.base.Supplier<T> supplier) |
static Expr.InputBindingInspector |
inspectorFromTypeMap(Map<String,ExpressionType> types)
Create an
Expr.InputBindingInspector backed by a map of binding identifiers to their ExprType |
static Expr.ObjectBinding |
nilBindings()
Empty
Expr.ObjectBinding that doesn't complain about attempts to access type or value for any input
identifiers, both of which will be nulls. |
static Expr.ObjectBinding |
validateConstant(Expr expr)
Empty binding that throw a
UOE if anything attempts to lookup an identifier type or value |
public static Expr.ObjectBinding nilBindings()
Expr.ObjectBinding that doesn't complain about attempts to access type or value for any input
identifiers, both of which will be nulls. Typically used for evaluating known constant expressions, or finding
a default or initial value of some expression if all inputs are null.public static Expr.ObjectBinding validateConstant(Expr expr)
UOE if anything attempts to lookup an identifier type or valuepublic static Expr.InputBindingInspector inspectorFromTypeMap(Map<String,ExpressionType> types)
Expr.InputBindingInspector backed by a map of binding identifiers to their ExprTypepublic static Expr.ObjectBinding forRow(Row row)
Expr.ObjectBinding backed by some Row. ColumnHolder.TIME_COLUMN_NAME is special
handled to be backed by Row.getTimestampFromEpoch(), all other values are ethically sourced from
Row.getRaw(String).
Types are detected and values are coereced via ExprEval.bestEffortOf(Object) because input types are
currently unknown.@Deprecated public static Expr.ObjectBinding forMap(Map<String,?> bindings)
Expr.ObjectBinding backed by Map to provide values for identifiers to evaluate Expr
Types are detected and values are coereced via ExprEval.bestEffortOf(Object) because input types are
currently unknown.
This method is only used for testing and mimics the behavior of forRow(Row) except lacks special handling
for columns named ColumnHolder.TIME_COLUMN_NAME.public static Expr.ObjectBinding forMap(Map<String,?> bindings, Expr.InputBindingInspector inspector)
Expr.ObjectBinding backed by Map to provide values for identifiers to evaluate Expr
Types are detected and values are coereced via ExprEval.bestEffortOf(Object) because input types are
currently unknown.public static Expr.ObjectBinding forInputSupplier(ExpressionType type, com.google.common.base.Supplier<?> supplier)
Expr.ObjectBinding for a single input value of a known type provided by some Supplierpublic static Expr.ObjectBinding forInputSupplier(String supplierName, ExpressionType type, com.google.common.base.Supplier<?> supplier)
Expr.ObjectBinding for a single input value of a known type provided by some Supplierpublic static <T> InputBindings.InputSupplier<T> inputSupplier(ExpressionType type, com.google.common.base.Supplier<T> supplier)
public static Expr.ObjectBinding forInputSuppliers(Map<String,InputBindings.InputSupplier<?>> bindings)
Expr.ObjectBinding backed by map of Supplier to provide values for identifiers to evaluate
ExprCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.