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 DimFilter |
toFilter(PlannerContext plannerContext,
RowSignature rowSignature,
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, 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 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 DimFilter toFilter(PlannerContext plannerContext, RowSignature rowSignature, org.apache.calcite.rex.RexNode expression)
plannerContext
- planner contextrowSignature
- row signature of the dataSource to be filteredexpression
- Calcite row expression@Nullable public static Granularity toQueryGranularity(DruidExpression expression, ExprMacroTable macroTable)
@Nullable public static TimestampFloorExprMacro.TimestampFloorExpr asTimestampFloorExpr(DruidExpression expression, ExprMacroTable macroTable)
Copyright © 2011–2018. All rights reserved.