Class KuduToEnumerableRel

java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.SingleRel
org.apache.calcite.rel.convert.ConverterImpl
com.twilio.kudu.sql.rel.KuduToEnumerableRel
All Implemented Interfaces:
Cloneable, org.apache.calcite.adapter.enumerable.EnumerableRel, org.apache.calcite.plan.RelOptNode, org.apache.calcite.rel.convert.Converter, org.apache.calcite.rel.PhysicalNode, org.apache.calcite.rel.RelNode

public class KuduToEnumerableRel extends org.apache.calcite.rel.convert.ConverterImpl implements org.apache.calcite.adapter.enumerable.EnumerableRel
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.calcite.adapter.enumerable.EnumerableRel

    org.apache.calcite.adapter.enumerable.EnumerableRel.Prefer, org.apache.calcite.adapter.enumerable.EnumerableRel.Result

    Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode

    org.apache.calcite.rel.RelNode.Context
  • Field Summary

    Fields inherited from class org.apache.calcite.rel.convert.ConverterImpl

    inTraits, traitDef

    Fields inherited from class org.apache.calcite.rel.SingleRel

    input

    Fields inherited from class org.apache.calcite.rel.AbstractRelNode

    digest, id, rowType, traitSet
  • Constructor Summary

    Constructors
    Constructor
    Description
    KuduToEnumerableRel(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traits, org.apache.calcite.rel.RelNode input)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.calcite.plan.RelOptCost
    computeSelfCost(org.apache.calcite.plan.RelOptPlanner planner, org.apache.calcite.rel.metadata.RelMetadataQuery mq)
     
    org.apache.calcite.rel.RelNode
    copy(org.apache.calcite.plan.RelTraitSet traitSet, List<org.apache.calcite.rel.RelNode> inputs)
     
    getPrimaryKeyColumnsInProjection(List<Integer> sortPkColumnIndices, List<Integer> projectedColumnIndices)
    Return the Integer indices in the Row Projection that match the primary key columns and in the order they need to match.
    org.apache.calcite.adapter.enumerable.EnumerableRel.Result
    implement(org.apache.calcite.adapter.enumerable.EnumerableRelImplementor implementor, org.apache.calcite.adapter.enumerable.EnumerableRel.Prefer pref)
     

    Methods inherited from class org.apache.calcite.rel.convert.ConverterImpl

    cannotImplement, getInputTraits, getTraitDef

    Methods inherited from class org.apache.calcite.rel.SingleRel

    childrenAccept, deriveRowType, estimateRowCount, explainTerms, getInput, getInputs, replaceInput

    Methods inherited from class org.apache.calcite.rel.AbstractRelNode

    accept, accept, collectVariablesSet, collectVariablesUsed, deepEquals, deepHashCode, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, sole, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.calcite.rel.convert.Converter

    getInput

    Methods inherited from interface org.apache.calcite.adapter.enumerable.EnumerableRel

    deriveTraits, getDeriveMode, passThroughTraits

    Methods inherited from interface org.apache.calcite.rel.PhysicalNode

    derive, derive, passThrough

    Methods inherited from interface org.apache.calcite.rel.RelNode

    accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, deepEquals, deepHashCode, estimateRowCount, explain, explain, fieldIsNullable, getConvention, getCorrelVariable, getDigest, getExpectedInputRowType, getInput, getInputs, getRelDigest, getRelTypeName, getRowType, getTable, getVariablesSet, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, replaceInput, stripped

    Methods inherited from interface org.apache.calcite.plan.RelOptNode

    getCluster, getDescription, getId, getTraitSet
  • Constructor Details

    • KuduToEnumerableRel

      public KuduToEnumerableRel(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traits, org.apache.calcite.rel.RelNode input)
  • Method Details

    • copy

      public org.apache.calcite.rel.RelNode copy(org.apache.calcite.plan.RelTraitSet traitSet, List<org.apache.calcite.rel.RelNode> inputs)
      Specified by:
      copy in interface org.apache.calcite.rel.RelNode
      Overrides:
      copy in class org.apache.calcite.rel.AbstractRelNode
    • computeSelfCost

      public org.apache.calcite.plan.RelOptCost computeSelfCost(org.apache.calcite.plan.RelOptPlanner planner, org.apache.calcite.rel.metadata.RelMetadataQuery mq)
      Specified by:
      computeSelfCost in interface org.apache.calcite.rel.RelNode
      Overrides:
      computeSelfCost in class org.apache.calcite.rel.convert.ConverterImpl
    • implement

      public org.apache.calcite.adapter.enumerable.EnumerableRel.Result implement(org.apache.calcite.adapter.enumerable.EnumerableRelImplementor implementor, org.apache.calcite.adapter.enumerable.EnumerableRel.Prefer pref)
      Specified by:
      implement in interface org.apache.calcite.adapter.enumerable.EnumerableRel
    • getPrimaryKeyColumnsInProjection

      public List<Integer> getPrimaryKeyColumnsInProjection(List<Integer> sortPkColumnIndices, List<Integer> projectedColumnIndices)
      Return the Integer indices in the Row Projection that match the primary key columns and in the order they need to match. This lays out how to compare two CalciteRows and determine which one is smaller.

      As an example, imagine we have a table (A, B, C, D, E) with primary columns in order of (A, B) and we have a scanner SELECT D, C, E, B, A the projectedSchema will be D, C, E, B, A and the tableSchema will be A, B, C, D, E *this* function will return List(4, 3) -- the position's of A and B within the projection and in the order they need to be sorted by.

      The returned index list is used by the sorted KuduEnumerable to merge the results from multiple scanners.

      Parameters:
      projectedColumnIndices - the indices of the columns that are being selected or required to evaluate a filter in memory
      sortPkColumnIndices - the indices of the primary key columns that are present in the ORDER BY clause
      Returns:
      List of column indexes that part of the primary key in the Kudu Sorted order