public class RexImpTable
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
RexImpTable.BinaryImplementor
Implementor for binary operators.
|
(package private) static class |
RexImpTable.BitOpImplementor
Implementor for the
BIT_AND and BIT_OR aggregate function. |
private static class |
RexImpTable.CaseImplementor
Implementor for the SQL
CASE operator. |
private static class |
RexImpTable.CastImplementor
Implementor for the SQL
CAST operator. |
private static class |
RexImpTable.CastOptimizedImplementor
Implementor for the SQL
CAST function that optimizes if, say, the
argument is already of the desired type. |
private static class |
RexImpTable.CoalesceImplementor
Implementor for the SQL
COALESCE operator. |
(package private) static class |
RexImpTable.CollectImplementor
Implementor for the
COLLECT aggregate function. |
(package private) static class |
RexImpTable.CountImplementor
Implementor for the
COUNT aggregate function. |
(package private) static class |
RexImpTable.CountWinImplementor
Implementor for the
COUNT windowed aggregate function. |
private static class |
RexImpTable.DatetimeArithmeticImplementor
Implementor for various datetime arithmetic.
|
(package private) static class |
RexImpTable.DenseRankImplementor
Implementor for the
DENSE_RANK windowed aggregate function. |
private static class |
RexImpTable.ExtractImplementor
Implementor for the
EXTRACT(unit FROM datetime) function. |
(package private) static class |
RexImpTable.FirstLastValueImplementor
Implementor for the
FIRST_VALUE and LAST_VALUE
windowed aggregate functions. |
(package private) static class |
RexImpTable.FirstValueImplementor
Implementor for the
FIRST_VALUE windowed aggregate function. |
private static class |
RexImpTable.FloorImplementor
Implementor for the
FLOOR and CEIL functions. |
(package private) static class |
RexImpTable.FusionImplementor
Implementor for the
FUSION aggregate function. |
(package private) static class |
RexImpTable.GroupingImplementor
Implementor for the
GROUPING aggregate function. |
private static class |
RexImpTable.IsXxxImplementor
Implements "IS XXX" operations such as "IS NULL"
or "IS NOT TRUE".
|
private static class |
RexImpTable.ItemImplementor
Implementor for the
ITEM SQL operator. |
(package private) static class |
RexImpTable.JsonArrayAggImplementor
Implementor for the
JSON_ARRAYAGG aggregate function. |
(package private) static class |
RexImpTable.JsonObjectAggImplementor
Implementor for the
JSON_OBJECTAGG aggregate function. |
static class |
RexImpTable.LagImplementor
Implementor for the
LAG windowed aggregate function. |
(package private) static class |
RexImpTable.LastValueImplementor
Implementor for the
LAST_VALUE windowed aggregate function. |
static class |
RexImpTable.LeadImplementor
Implementor for the
LEAD windowed aggregate function. |
(package private) static class |
RexImpTable.LeadLagImplementor
Implementor for the
LEAD and LAG windowed
aggregate functions. |
(package private) static class |
RexImpTable.ListaggImplementor
Implementor for the
LISTAGG aggregate function. |
private static class |
RexImpTable.MethodImplementor
Implementor for a function that generates calls to a given method.
|
private static class |
RexImpTable.MethodNameImplementor
Implementor for SQL functions that generates calls to a given method name.
|
(package private) static class |
RexImpTable.MinMaxImplementor
Implementor for the
MIN and MAX aggregate functions. |
private static class |
RexImpTable.NotImplementor
Implementor for the
NOT operator. |
(package private) static class |
RexImpTable.NthValueImplementor
Implementor for the
NTH_VALUE
windowed aggregate function. |
(package private) static class |
RexImpTable.NtileImplementor
Implementor for the
NTILE windowed aggregate function. |
static class |
RexImpTable.NullAs
Strategy what an operator should return if one of its
arguments is null.
|
(package private) static class |
RexImpTable.RankImplementor
Implementor for the
RANK windowed aggregate function. |
private static class |
RexImpTable.ReinterpretImplementor
Implementor for the
REINTERPRET internal SQL operator. |
(package private) static class |
RexImpTable.RowNumberImplementor
Implementor for the
ROW_NUMBER windowed aggregate function. |
(package private) static class |
RexImpTable.SingleValueImplementor
Implementor for the
SINGLE_VALUE aggregate function. |
(package private) static class |
RexImpTable.SumImplementor
Implementor for the
SUM windowed aggregate function. |
private static class |
RexImpTable.SystemFunctionImplementor
Implementor for SQL system functions.
|
private static class |
RexImpTable.TrimImplementor
Implementor for the
TRIM function. |
private static class |
RexImpTable.UnaryImplementor
Implementor for unary operators.
|
static class |
RexImpTable.UserDefinedAggReflectiveImplementor
Implementor for user-defined aggregate functions.
|
private static class |
RexImpTable.ValueConstructorImplementor
Implementor for a value-constructor.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<SqlAggFunction,java.util.function.Supplier<? extends AggImplementor>> |
aggMap |
static MemberExpression |
BOXED_FALSE_EXPR |
static MemberExpression |
BOXED_TRUE_EXPR |
static ConstantExpression |
COMMA_EXPR |
static ConstantExpression |
FALSE_EXPR |
static RexImpTable |
INSTANCE |
private java.util.Map<SqlOperator,CallImplementor> |
map |
static ConstantExpression |
NULL_EXPR |
static ConstantExpression |
TRUE_EXPR |
private java.util.Map<SqlAggFunction,java.util.function.Supplier<? extends WinAggImplementor>> |
winAggMap |
Constructor and Description |
---|
RexImpTable() |
Modifier and Type | Method and Description |
---|---|
private static <E> boolean |
allSame(java.util.List<E> list) |
private static RexCall |
call2(boolean harmonize,
RexToLixTranslator translator,
RexCall call) |
private <T> java.util.function.Supplier<T> |
constructorSupplier(java.lang.Class<T> klass) |
static CallImplementor |
createImplementor(NotNullImplementor implementor,
NullPolicy nullPolicy,
boolean harmonize) |
private void |
defineBinary(SqlOperator operator,
ExpressionType expressionType,
NullPolicy nullPolicy,
java.lang.String backupMethodName) |
private void |
defineImplementor(SqlOperator operator,
NullPolicy nullPolicy,
NotNullImplementor implementor,
boolean harmonize) |
private void |
defineMethod(SqlOperator operator,
java.lang.reflect.Method method,
NullPolicy nullPolicy) |
private void |
defineMethod(SqlOperator operator,
java.lang.String functionName,
NullPolicy nullPolicy) |
private void |
defineMethodReflective(SqlOperator operator,
java.lang.reflect.Method method,
NullPolicy nullPolicy) |
private void |
defineUnary(SqlOperator operator,
ExpressionType expressionType,
NullPolicy nullPolicy) |
AggImplementor |
get(SqlAggFunction aggregation,
boolean forWindowAggregate) |
CallImplementor |
get(SqlOperator operator) |
(package private) static Expression |
getDefaultValue(java.lang.reflect.Type type) |
private static long |
getFactor(org.apache.calcite.avatica.util.TimeUnit unit) |
private static java.util.List<RexNode> |
harmonize(RexToLixTranslator translator,
java.util.List<RexNode> operands)
Ensures that operands have identical type.
|
private static Expression |
implementCall(RexToLixTranslator translator,
RexCall call,
NotNullImplementor implementor,
RexImpTable.NullAs nullAs) |
private static Expression |
implementNullSemantics(RexToLixTranslator translator,
RexCall call,
RexImpTable.NullAs nullAs,
NullPolicy nullPolicy,
NotNullImplementor implementor) |
private static Expression |
implementNullSemantics0(RexToLixTranslator translator,
RexCall call,
RexImpTable.NullAs nullAs,
NullPolicy nullPolicy,
boolean harmonize,
NotNullImplementor implementor) |
(package private) static Expression |
maybeNegate(boolean negate,
Expression expression) |
private static Expression |
mod(Expression operand,
long factor) |
static Expression |
multiplyDivide(Expression e,
java.math.BigDecimal multiplier,
java.math.BigDecimal divider)
Multiplies an expression by a constant and divides by another constant,
optimizing appropriately.
|
private static boolean |
nullable(RexCall call,
int i) |
(package private) static Expression |
optimize(Expression expression) |
(package private) static Expression |
optimize2(Expression operand,
Expression expression) |
private static RelDataType |
toSql(RelDataTypeFactory typeFactory,
RelDataType type) |
public static final ConstantExpression NULL_EXPR
public static final ConstantExpression FALSE_EXPR
public static final ConstantExpression TRUE_EXPR
public static final ConstantExpression COMMA_EXPR
public static final MemberExpression BOXED_FALSE_EXPR
public static final MemberExpression BOXED_TRUE_EXPR
private final java.util.Map<SqlOperator,CallImplementor> map
private final java.util.Map<SqlAggFunction,java.util.function.Supplier<? extends AggImplementor>> aggMap
private final java.util.Map<SqlAggFunction,java.util.function.Supplier<? extends WinAggImplementor>> winAggMap
public static final RexImpTable INSTANCE
private <T> java.util.function.Supplier<T> constructorSupplier(java.lang.Class<T> klass)
private void defineImplementor(SqlOperator operator, NullPolicy nullPolicy, NotNullImplementor implementor, boolean harmonize)
private static RexCall call2(boolean harmonize, RexToLixTranslator translator, RexCall call)
public static CallImplementor createImplementor(NotNullImplementor implementor, NullPolicy nullPolicy, boolean harmonize)
private void defineMethod(SqlOperator operator, java.lang.String functionName, NullPolicy nullPolicy)
private void defineMethod(SqlOperator operator, java.lang.reflect.Method method, NullPolicy nullPolicy)
private void defineMethodReflective(SqlOperator operator, java.lang.reflect.Method method, NullPolicy nullPolicy)
private void defineUnary(SqlOperator operator, ExpressionType expressionType, NullPolicy nullPolicy)
private void defineBinary(SqlOperator operator, ExpressionType expressionType, NullPolicy nullPolicy, java.lang.String backupMethodName)
public CallImplementor get(SqlOperator operator)
public AggImplementor get(SqlAggFunction aggregation, boolean forWindowAggregate)
static Expression maybeNegate(boolean negate, Expression expression)
static Expression optimize(Expression expression)
static Expression optimize2(Expression operand, Expression expression)
private static boolean nullable(RexCall call, int i)
private static java.util.List<RexNode> harmonize(RexToLixTranslator translator, java.util.List<RexNode> operands)
private static RelDataType toSql(RelDataTypeFactory typeFactory, RelDataType type)
private static <E> boolean allSame(java.util.List<E> list)
private static Expression implementNullSemantics0(RexToLixTranslator translator, RexCall call, RexImpTable.NullAs nullAs, NullPolicy nullPolicy, boolean harmonize, NotNullImplementor implementor)
private static Expression implementNullSemantics(RexToLixTranslator translator, RexCall call, RexImpTable.NullAs nullAs, NullPolicy nullPolicy, NotNullImplementor implementor)
private static Expression implementCall(RexToLixTranslator translator, RexCall call, NotNullImplementor implementor, RexImpTable.NullAs nullAs)
static Expression getDefaultValue(java.lang.reflect.Type type)
public static Expression multiplyDivide(Expression e, java.math.BigDecimal multiplier, java.math.BigDecimal divider)
For example, multiplyDivide(e, 10, 1000)
returns
e / 100
.
private static Expression mod(Expression operand, long factor)
private static long getFactor(org.apache.calcite.avatica.util.TimeUnit unit)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.