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

Allow ProjectSetOpTransposeRule to work with any subclass of Project

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.37.0
    • 1.38.0
    • core

    Description

      Even if the default configuration of ProjectSetOpTransposeRule matches a LogicalProject, theoretically any downstream project could adjust the rule config to match a different subclass of Project, with the corresponding RelBuilderFactory, to obtain the rule behavior customized for their needs.

      However, at this point this cannot work because ProjectSetOpTransposeRule#onMatch performs a

      final LogicalProject origProject = call.rel(0);
      

      which leads to a ClassCastException in this scenario.

      Therefore, this line should be changed (and generalized) into

      final Project origProject = call.rel(0);
      

      (as it happens already in other rules, such as FilterSetOpTransposeRule or ProjectFilterTransposeRule) to improve the rule's adaptability, without impacting the rule's behavior.

      Attachments

        Issue Links

          Activity

            People

              rubenql Ruben Q L
              rubenql Ruben Q L
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: