public class Expressions extends Object
| Modifier and Type | Method and Description |
|---|---|
static TimestampFloorExprMacro.TimestampFloorExpr |
asTimestampFloorExpr(DruidExpression expression,
ExprMacroTable macroTable) |
static ExprType |
exprTypeForValueType(ValueType valueType) |
static org.apache.calcite.rex.RexNode |
fromFieldAccess(RowSignature rowSignature,
org.apache.calcite.rel.core.Project project,
int fieldNumber)
Translate a field access, possibly through a projection, to an underlying Druid dataSource.
|
static DruidExpression |
toDruidExpression(PlannerContext plannerContext,
RowSignature rowSignature,
org.apache.calcite.rex.RexNode rexNode)
Translate a Calcite
RexNode to a Druid expressions. |
static List<DruidExpression> |
toDruidExpressions(PlannerContext plannerContext,
RowSignature rowSignature,
List<org.apache.calcite.rex.RexNode> rexNodes)
Translate a list of Calcite
RexNode to Druid expressions. |
static List<DruidExpression> |
toDruidExpressionsWithPostAggOperands(PlannerContext plannerContext,
RowSignature rowSignature,
List<org.apache.calcite.rex.RexNode> rexNodes,
PostAggregatorVisitor postAggregatorVisitor)
Translate a list of Calcite
RexNode to Druid expressions, with the possibility of having postagg operands. |
static DruidExpression |
toDruidExpressionWithPostAggOperands(PlannerContext plannerContext,
RowSignature rowSignature,
org.apache.calcite.rex.RexNode rexNode,
PostAggregatorVisitor postAggregatorVisitor) |
static DimFilter |
toFilter(PlannerContext plannerContext,
RowSignature rowSignature,
VirtualColumnRegistry virtualColumnRegistry,
org.apache.calcite.rex.RexNode expression)
Translates "condition" to a Druid filter, or returns null if we cannot translate the condition.
|
static Granularity |
toQueryGranularity(DruidExpression expression,
ExprMacroTable macroTable)
Converts an expression to a Granularity, if possible.
|
public static org.apache.calcite.rex.RexNode fromFieldAccess(RowSignature rowSignature, @Nullable org.apache.calcite.rel.core.Project project, int fieldNumber)
rowSignature - row signature of underlying Druid dataSourceproject - projection, or nullfieldNumber - number of the field to access@Nullable public static List<DruidExpression> toDruidExpressions(PlannerContext plannerContext, RowSignature rowSignature, List<org.apache.calcite.rex.RexNode> rexNodes)
RexNode to Druid expressions.plannerContext - SQL planner contextrowSignature - signature of the rows to be extracted fromrexNodes - list of Calcite expressions meant to be applied on top of the rows@Nullable public static List<DruidExpression> toDruidExpressionsWithPostAggOperands(PlannerContext plannerContext, RowSignature rowSignature, List<org.apache.calcite.rex.RexNode> rexNodes, PostAggregatorVisitor postAggregatorVisitor)
RexNode to Druid expressions, with the possibility of having postagg operands.plannerContext - SQL planner contextrowSignature - signature of the rows to be extracted fromrexNodes - list of Calcite expressions meant to be applied on top of the rowspostAggregatorVisitor - visitor that manages postagg names and tracks postaggs that were created as
by the translation@Nullable public static DruidExpression toDruidExpression(PlannerContext plannerContext, RowSignature rowSignature, org.apache.calcite.rex.RexNode rexNode)
RexNode to a Druid expressions.plannerContext - SQL planner contextrowSignature - signature of the rows to be extracted fromrexNode - expression meant to be applied on top of the rows@Nullable public static DruidExpression toDruidExpressionWithPostAggOperands(PlannerContext plannerContext, RowSignature rowSignature, org.apache.calcite.rex.RexNode rexNode, @Nullable PostAggregatorVisitor postAggregatorVisitor)
@Nullable public static DimFilter toFilter(PlannerContext plannerContext, RowSignature rowSignature, @Nullable VirtualColumnRegistry virtualColumnRegistry, org.apache.calcite.rex.RexNode expression)
plannerContext - planner contextrowSignature - input row signaturevirtualColumnRegistry - re-usable virtual column references, may be null if virtual columns aren't allowedexpression - Calcite row expression@Nullable public static Granularity toQueryGranularity(DruidExpression expression, ExprMacroTable macroTable)
@Nullable public static TimestampFloorExprMacro.TimestampFloorExpr asTimestampFloorExpr(DruidExpression expression, ExprMacroTable macroTable)
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.