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

Composite EnumerableSort with DESC wrongly sorts NULL values low

    Details

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

      Description

      NULL first or NULL last is not clearly defined by sql spec, but should be consistent in calcite.

      I spot order by (A desc) returns NULL last, but order by (A desc, B) returns NULL first.

      E.g. "select cal_dt, country, ... from xxx order by COUNTRY DESC" returns

      2013-08-11 US ....
      2013-08-18 FR ....
      2013-03-31 null ....
      2013-11-10 null ....

      E.g. "select cal_dt, country, ... from xxx order by COUNTRY DESC, CAL_DT ASC" returns

      2013-03-31 null ....
      2013-11-10 null ....
      2013-08-11 US ....
      2013-08-18 FR ....

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              liyang.gmt8@gmail.com liyang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: