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

Ignore duplicate ORDER BY keys, and ensure RelCollation contains no duplicates

    Details

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

      Description

      I test the query SELECT a, c FROM MyTable ORDER BY a DESC, a DESC. And the collation of LogicalSort is [0 DESC, 0 DESC] , thus it will order by the repeater fields. I think the calcite should removal the repeated fields, thus it make the LogicalSort whose collation is [0 DESC] be more reasonable.
      Considering compatibility´╝îit may be better make SqlToRelConverter (or perhaps RelBuilder) ignore sort keys that have appeared earlier in the key. In addition, it should also prevent the incompatible sort keys. It should throw illegalargumentexception for the query SELECT a, c FROM MyTable ORDER BY a DESC, a ASC because of the incompatibility.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              hustfxj John Fang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: