Class AliasedOperatorConversion
java.lang.Object
org.apache.druid.sql.calcite.expression.AliasedOperatorConversion
- All Implemented Interfaces:
SqlOperatorConversion
- Direct Known Subclasses:
MultiValueStringOperatorConversions.Length,MultiValueStringOperatorConversions.MultiStringToString,MultiValueStringOperatorConversions.OffsetOf,MultiValueStringOperatorConversions.OrdinalOf
-
Constructor Summary
ConstructorsConstructorDescriptionAliasedOperatorConversion(SqlOperatorConversion baseConversion, String name) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.calcite.sql.SqlOperatorReturns the SQL operator corresponding to this function.toDruidExpression(PlannerContext plannerContext, RowSignature rowSignature, org.apache.calcite.rex.RexNode rexNode) Translate a CalciteRexNodeto a Druid expression.toDruidExpressionWithPostAggOperands(PlannerContext plannerContext, RowSignature rowSignature, org.apache.calcite.rex.RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor) Translate a CalciteRexNodeto a Druid expression, with the possibility of having postagg operands.toDruidFilter(PlannerContext plannerContext, RowSignature rowSignature, VirtualColumnRegistry virtualColumnRegistry, org.apache.calcite.rex.RexNode rexNode) Returns a Druid filter corresponding to a CalciteRexNodeused as a filter condition.toPostAggregator(PlannerContext plannerContext, RowSignature querySignature, org.apache.calcite.rex.RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor) Returns a Druid PostAggregator corresponding to a CalciteRexNodeused to transform a row after aggregation has occurred.
-
Constructor Details
-
AliasedOperatorConversion
-
-
Method Details
-
calciteOperator
public org.apache.calcite.sql.SqlOperator calciteOperator()Description copied from interface:SqlOperatorConversionReturns the SQL operator corresponding to this function. Should be a singleton.- Specified by:
calciteOperatorin interfaceSqlOperatorConversion- Returns:
- operator
-
toDruidExpression
public DruidExpression toDruidExpression(PlannerContext plannerContext, RowSignature rowSignature, org.apache.calcite.rex.RexNode rexNode) Description copied from interface:SqlOperatorConversionTranslate a CalciteRexNodeto a Druid expression.- Specified by:
toDruidExpressionin interfaceSqlOperatorConversion- Parameters:
plannerContext- SQL planner contextrowSignature- signature of the rows to be extracted fromrexNode- expression meant to be applied on top of the rows- Returns:
- Druid expression, or null if translation is not possible
- See Also:
-
toDruidExpressionWithPostAggOperands
@Nullable public DruidExpression toDruidExpressionWithPostAggOperands(PlannerContext plannerContext, RowSignature rowSignature, org.apache.calcite.rex.RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor) Description copied from interface:SqlOperatorConversionTranslate a CalciteRexNodeto a Druid expression, with the possibility of having postagg operands.- Specified by:
toDruidExpressionWithPostAggOperandsin interfaceSqlOperatorConversion- Parameters:
plannerContext- SQL planner contextrowSignature- signature of the rows to be extracted fromrexNode- expression meant to be applied on top of the rowspostAggregatorVisitor- visitor that manages postagg names and tracks postaggs that were created as by the translation- Returns:
- Druid expression, or null if translation is not possible
- See Also:
-
toDruidFilter
@Nullable public DimFilter toDruidFilter(PlannerContext plannerContext, RowSignature rowSignature, @Nullable VirtualColumnRegistry virtualColumnRegistry, org.apache.calcite.rex.RexNode rexNode) Description copied from interface:SqlOperatorConversionReturns a Druid filter corresponding to a CalciteRexNodeused as a filter condition.- Specified by:
toDruidFilterin interfaceSqlOperatorConversion- Parameters:
plannerContext- SQL planner contextrowSignature- input row signaturevirtualColumnRegistry- re-usable virtual column referencesrexNode- filter expression rex node- Returns:
- filter, or null if the call cannot be translated to a filter
-
toPostAggregator
@Nullable public PostAggregator toPostAggregator(PlannerContext plannerContext, RowSignature querySignature, org.apache.calcite.rex.RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor) Description copied from interface:SqlOperatorConversionReturns a Druid PostAggregator corresponding to a CalciteRexNodeused to transform a row after aggregation has occurred.- Specified by:
toPostAggregatorin interfaceSqlOperatorConversion- Parameters:
plannerContext- SQL planner contextquerySignature- signature of the rows to be extracted fromrexNode- expression meant to be applied on top of the rowspostAggregatorVisitor- visitor that manages postagg names and tracks postaggs that were created by the translation- Returns:
- filter, or null if the call cannot be translated
-