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

public class AliasedOperatorConversion extends Object implements SqlOperatorConversion
  • Constructor Details

  • Method Details

    • calciteOperator

      public org.apache.calcite.sql.SqlOperator calciteOperator()
      Description copied from interface: SqlOperatorConversion
      Returns the SQL operator corresponding to this function. Should be a singleton.
      Specified by:
      calciteOperator in interface SqlOperatorConversion
      Returns:
      operator
    • toDruidExpression

      public DruidExpression toDruidExpression(PlannerContext plannerContext, RowSignature rowSignature, org.apache.calcite.rex.RexNode rexNode)
      Description copied from interface: SqlOperatorConversion
      Translate a Calcite RexNode to a Druid expression.
      Specified by:
      toDruidExpression in interface SqlOperatorConversion
      Parameters:
      plannerContext - SQL planner context
      rowSignature - signature of the rows to be extracted from
      rexNode - 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: SqlOperatorConversion
      Translate a Calcite RexNode to a Druid expression, with the possibility of having postagg operands.
      Specified by:
      toDruidExpressionWithPostAggOperands in interface SqlOperatorConversion
      Parameters:
      plannerContext - SQL planner context
      rowSignature - signature of the rows to be extracted from
      rexNode - expression meant to be applied on top of the rows
      postAggregatorVisitor - 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: SqlOperatorConversion
      Returns a Druid filter corresponding to a Calcite RexNode used as a filter condition.
      Specified by:
      toDruidFilter in interface SqlOperatorConversion
      Parameters:
      plannerContext - SQL planner context
      rowSignature - input row signature
      virtualColumnRegistry - re-usable virtual column references
      rexNode - 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: SqlOperatorConversion
      Returns a Druid PostAggregator corresponding to a Calcite RexNode used to transform a row after aggregation has occurred.
      Specified by:
      toPostAggregator in interface SqlOperatorConversion
      Parameters:
      plannerContext - SQL planner context
      querySignature - signature of the rows to be extracted from
      rexNode - expression meant to be applied on top of the rows
      postAggregatorVisitor - visitor that manages postagg names and tracks postaggs that were created by the translation
      Returns:
      filter, or null if the call cannot be translated