Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-1062

DRILL does not handle NULLS FIRST/LAST correctly in ORDER BY clause

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.8.0
    • Functions - Drill
    • None

    Description

      ORDER BY clause could specify nulls first or nulls last. Currently, DRILL will always use nulls last policy.

      select tbl.topping[3].type from dfs.`/Users/jni/work/incubator-drill/exec/ref/target/test-classes/donuts.json` as tbl order by 1 nulls last;
      ------------

      EXPR$0

      ------------

      Chocolate
      Maple
      Powdered Sugar
      Powdered Sugar
      null

      ------------
      5 rows selected (0.156 seconds)
      0: jdbc:drill:zk=local> select tbl.topping[3].type from dfs.`/Users/jni/work/incubator-drill/exec/ref/target/test-classes/donuts.json` as tbl order by 1 nulls first;
      ------------

      EXPR$0

      ------------

      Chocolate
      Maple
      Powdered Sugar
      Powdered Sugar
      null

      ------------
      5 rows selected (0.186 seconds)

      Attachments

        1. DRILL-1062.2.patch
          126 kB
          Daniel Barclay
        2. DRILL-1062.3.patch.txt
          127 kB
          Daniel Barclay
        3. DRILL-1062.4.patch.txt
          271 kB
          Daniel Barclay

        Issue Links

          Activity

            People

              cchang@maprtech.com Chun Chang
              jni Jinfeng Ni
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: