Class VectorProcessors
- java.lang.Object
-
- org.apache.druid.math.expr.vector.VectorProcessors
-
public class VectorProcessors extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ExprVectorProcessor<T>and(Expr.VectorInputBindingInspector inputTypes, Expr left, Expr right)Creates anExprVectorProcessorfor the logical 'and' operator, which produces a long typed vector output with values set by the following rules: true/true -> true (1) true/null, null/true, null/null -> null false/null, null/false -> false (0)static <T> ExprVectorProcessor<T>constant(Double constant, int maxVectorSize)static <T> ExprVectorProcessor<T>constant(Long constant, int maxVectorSize)static <T> ExprVectorProcessor<T>constant(String constant, int maxVectorSize)static ExprVectorProcessor<?>identifier(Expr.VectorInputBindingInspector inspector, String binding)Creates anExprVectorProcessorthat creates aExprEvalVectorfor some expression variable input binding, typically for segment column value vectors from aVectorValueSelectororVectorObjectSelector.static <T> ExprVectorProcessor<T>isNotNull(Expr.VectorInputBindingInspector inspector, Expr expr)Creates anExprVectorProcessorfor the 'isnotnull' function, that produces a "boolean" typed output vector (long[]) with values set to 1 if the input value was not null or 0 if it was null.static <T> ExprVectorProcessor<T>isNull(Expr.VectorInputBindingInspector inspector, Expr expr)Creates anExprVectorProcessorfor the 'isnull' function, that produces a "boolean" typed output vector (long[]) with values set to 1 if the input value was null or 0 if it was not null.static <T> ExprVectorProcessor<T>makeSymmetricalProcessor(Expr.VectorInputBindingInspector inspector, Expr left, Expr right, Supplier<ExprVectorProcessor<?>> longProcessor, Supplier<ExprVectorProcessor<?>> doubleProcessor, Supplier<ExprVectorProcessor<?>> stringProcessor)Make a 2 argument, symmetrical processor where both argments must be the same input type and produce the same output type long, long -> long double, double -> double string, string -> stringstatic <T> ExprVectorProcessor<T>not(Expr.VectorInputBindingInspector inspector, Expr expr)Creates anExprVectorProcessorfor the logical 'not' operator, which produces a long typed vector output with values set by the following rules: false -> true (1) null -> null true -> false (0)static <T> ExprVectorProcessor<T>nvl(Expr.VectorInputBindingInspector inspector, Expr left, Expr right)Creates anExprVectorProcessorfor the 'nvl' function, that will return the first argument value if it is not null, else the value of the 2nd argument.static <T> ExprVectorProcessor<T>or(Expr.VectorInputBindingInspector inspector, Expr left, Expr right)Creates anExprVectorProcessorfor the logical 'or' operator, which produces a long typed vector output with values set by the following rules: true/null, null/true -> true (1) false/null, null/false, null/null -> null false/false -> false (0)static <T> ExprVectorProcessor<T>parseLong(Expr.VectorInputBindingInspector inspector, Expr arg, int radix)Creates anExprVectorProcessorthat will parse a string into a long value given a radix.
-
-
-
Method Detail
-
makeSymmetricalProcessor
public static <T> ExprVectorProcessor<T> makeSymmetricalProcessor(Expr.VectorInputBindingInspector inspector, Expr left, Expr right, Supplier<ExprVectorProcessor<?>> longProcessor, Supplier<ExprVectorProcessor<?>> doubleProcessor, Supplier<ExprVectorProcessor<?>> stringProcessor)
Make a 2 argument, symmetrical processor where both argments must be the same input type and produce the same output type long, long -> long double, double -> double string, string -> string
-
constant
public static <T> ExprVectorProcessor<T> constant(@Nullable String constant, int maxVectorSize)
- See Also:
ConstantExpr
-
constant
public static <T> ExprVectorProcessor<T> constant(@Nullable Double constant, int maxVectorSize)
- See Also:
ConstantExpr
-
constant
public static <T> ExprVectorProcessor<T> constant(@Nullable Long constant, int maxVectorSize)
- See Also:
ConstantExpr
-
identifier
public static ExprVectorProcessor<?> identifier(Expr.VectorInputBindingInspector inspector, String binding)
Creates anExprVectorProcessorthat creates aExprEvalVectorfor some expression variable input binding, typically for segment column value vectors from aVectorValueSelectororVectorObjectSelector.- See Also:
IdentifierExpr
-
parseLong
public static <T> ExprVectorProcessor<T> parseLong(Expr.VectorInputBindingInspector inspector, Expr arg, int radix)
Creates anExprVectorProcessorthat will parse a string into a long value given a radix.- See Also:
Function.ParseLong
-
isNull
public static <T> ExprVectorProcessor<T> isNull(Expr.VectorInputBindingInspector inspector, Expr expr)
Creates anExprVectorProcessorfor the 'isnull' function, that produces a "boolean" typed output vector (long[]) with values set to 1 if the input value was null or 0 if it was not null.- See Also:
Function.IsNullFunc
-
isNotNull
public static <T> ExprVectorProcessor<T> isNotNull(Expr.VectorInputBindingInspector inspector, Expr expr)
Creates anExprVectorProcessorfor the 'isnotnull' function, that produces a "boolean" typed output vector (long[]) with values set to 1 if the input value was not null or 0 if it was null.- See Also:
Function.IsNotNullFunc
-
nvl
public static <T> ExprVectorProcessor<T> nvl(Expr.VectorInputBindingInspector inspector, Expr left, Expr right)
Creates anExprVectorProcessorfor the 'nvl' function, that will return the first argument value if it is not null, else the value of the 2nd argument.- See Also:
Function.NvlFunc
-
not
public static <T> ExprVectorProcessor<T> not(Expr.VectorInputBindingInspector inspector, Expr expr)
Creates anExprVectorProcessorfor the logical 'not' operator, which produces a long typed vector output with values set by the following rules: false -> true (1) null -> null true -> false (0)- See Also:
UnaryNotExpr
-
or
public static <T> ExprVectorProcessor<T> or(Expr.VectorInputBindingInspector inspector, Expr left, Expr right)
Creates anExprVectorProcessorfor the logical 'or' operator, which produces a long typed vector output with values set by the following rules: true/null, null/true -> true (1) false/null, null/false, null/null -> null false/false -> false (0)- See Also:
BinOrExpr
-
and
public static <T> ExprVectorProcessor<T> and(Expr.VectorInputBindingInspector inputTypes, Expr left, Expr right)
Creates anExprVectorProcessorfor the logical 'and' operator, which produces a long typed vector output with values set by the following rules: true/true -> true (1) true/null, null/true, null/null -> null false/null, null/false -> false (0)- See Also:
BinAndExpr
-
-