Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5705

Generalize RemoveEmptySingleRule to work with arbitrary relations and pruning configurations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.35.0
    • core
    • None

    Description

      Currently RemoveEmptySingleRule can only transform SingleRel relations to empty. However, the logic inside the matches method is at the most part capable of handling any kind of relation including those that have multiple children.

      By generalizing the RemoveEmptySingleRule to work with arbitrary relations we can refactor other pruning rules such as those created by CorrelateLeftEmptyRuleConfig without the need for creating more classes and duplicating code.

      Moreover by changing the constructor to accept PruneEmptyRule.Config instead of RemoveEmptySingleRuleConfig we can reduce code duplication further since configurations such as ZeroMaxRowsRuleConfig and SortFetchZeroRuleConfig could be modified to create instances of RemoveEmptySingleRule.

      This is mainly a refactoring to simplify pruning rules and remove duplicate logic. The change is fully backwards compatible.

      Attachments

        Activity

          People

            zabetak Stamatis Zampetakis
            zabetak Stamatis Zampetakis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: