Class PushLimitIntoTableSourceScanRule


  • public class PushLimitIntoTableSourceScanRule
    extends org.apache.calcite.plan.RelOptRule
    Planner rule that tries to push limit into a FlinkLogicalTableSourceScan, which table is a TableSourceTable. And the table source in the table is a SupportsLimitPushDown. The original limit will still be retained. The reasons why the limit still be retained: 1.If the source is required to return the exact number of limit number, the implementation of the source is highly required. The source is required to accurately control the record number of split, and the parallelism setting also need to be adjusted accordingly. 2.When remove the limit, maybe filter will be pushed down to the source after limit pushed down. The source need know it should do limit first and do the filter later, it is hard to implement. 3.We can support limit with offset, we can push down offset + fetch to table source.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.calcite.plan.RelOptRule

        org.apache.calcite.plan.RelOptRule.ConverterRelOptRuleOperand
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static PushLimitIntoTableSourceScanRule INSTANCE  
      • Fields inherited from class org.apache.calcite.plan.RelOptRule

        description, operands, relBuilderFactory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean matches​(org.apache.calcite.plan.RelOptRuleCall call)  
      void onMatch​(org.apache.calcite.plan.RelOptRuleCall call)  
      • Methods inherited from class org.apache.calcite.plan.RelOptRule

        any, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
    • Constructor Detail

      • PushLimitIntoTableSourceScanRule

        public PushLimitIntoTableSourceScanRule()
    • Method Detail

      • matches

        public boolean matches​(org.apache.calcite.plan.RelOptRuleCall call)
        Overrides:
        matches in class org.apache.calcite.plan.RelOptRule
      • onMatch

        public void onMatch​(org.apache.calcite.plan.RelOptRuleCall call)
        Specified by:
        onMatch in class org.apache.calcite.plan.RelOptRule