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

AggregateUnionTransposeRule causes row type mismatch when some inputs have unique grouping key

    XMLWordPrintableJSON

Details

    Description

      Consider the following relational tree:

      1: Aggregate[group=a, SUM(b)]
      2:   Union
      3:     Input1[a, b, c]
      4:     Input2[a, b, c]
      

      It may happen, that Input1 has a unique key on [a]. In this case, Apache Calcite, will not install the Aggregate on top of it, which leads to the following tree:

      1: Aggregate[group=a, SUM(b)]
      2:   Union
      3:     Input1[a, b, c]
      4:     Aggregate[group=a, SUM(b)]
      5:       Input2[a, b, c]
      

      Obviously, the tree is incorrect, because Union inputs now have different row types.

      Attachments

        Issue Links

          Activity

            People

              vozerov Vladimir Ozerov
              vozerov Vladimir Ozerov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h