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

EnumerableLimitRule on Sort with no collation creates EnumerableLimit with wrong traitSet and cluster

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.18.0
    • Fix Version/s: 1.20.0
    • Component/s: None

      Description

      EnumerableLimitRule "converst a Sort that has offset or fetch set to an EnumerableLimit on top of a 'pure' Sort that has no offset or fetch". This is the "normal" scenario, and there is no issue with that.
      However, there is another scenario, where the EnumerableLimitRule is applied on an "empty" Sort (with no field collations) with offset / fetch. In that case, the EnumerableLimit's input will not be the Sort (because it will disappear, since it was empty), but the Sort's input. The problem comes in this case, because the EnumerableLimit will be created with the Sort's traitSet and cluster; instead of the Sort's input (which is the actual EnumerableLimit input) traitSet and cluster.
      Probably the bug can be easily fixed by using EnumerableLimit#create method, instead of EnumerableLimit's constructor.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rubenql Ruben Q L
                Reporter:
                rubenql Ruben Q L
              • Votes:
                0 Vote for this issue
                Watchers:
                3 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 - 40m
                  40m