Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-1972

Invalid sort order with NULLS FIRST|LAST

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.12.0, 0.11.1
    • Component/s: None
    • Labels:
      None

      Description

      Currently, the order of nulls is affected by the sort order (asc and desc), but should not. Here is the example of pgsql's behaviour.

      postgres=# select * from test;
       id | name  
      ----+-------
        0 | test1
        1 | 
          | test2
      (3 rows)
      postgres=# select * from test order by id  asc nulls first;
       id | name  
      ----+-------
          | test2
        0 | test1
        1 | 
      (3 rows)
      
      postgres=# select * from test order by id  desc nulls first;
       id | name  
      ----+-------
          | test2
        1 | 
        0 | test1
      (3 rows)
      

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #969 (See https://builds.apache.org/job/Tajo-master-build/969/)
        TAJO-1972: Invalid sort order with NULLS FIRST|LAST. (jihoonson: rev 46bc8bf7901ca124c76a6c1cfb0c3b161c8ad7d2)

        • tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/BaseTupleComparator.java
        • tajo-plan/src/main/java/org/apache/tajo/plan/logical/SortNode.java
        • CHANGES
        • tajo-storage/tajo-storage-common/src/test/java/org/apache/tajo/storage/TestTupleComparator.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #969 (See https://builds.apache.org/job/Tajo-master-build/969/ ) TAJO-1972 : Invalid sort order with NULLS FIRST|LAST. (jihoonson: rev 46bc8bf7901ca124c76a6c1cfb0c3b161c8ad7d2) tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/BaseTupleComparator.java tajo-plan/src/main/java/org/apache/tajo/plan/logical/SortNode.java CHANGES tajo-storage/tajo-storage-common/src/test/java/org/apache/tajo/storage/TestTupleComparator.java
        Hide
        jihoonson Jihoon Son added a comment -

        Committed to master and 0.11.1

        Show
        jihoonson Jihoon Son added a comment - Committed to master and 0.11.1
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Tajo-master-CODEGEN-build #587 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/587/)
        TAJO-1972: Invalid sort order with NULLS FIRST|LAST. (jihoonson: rev 46bc8bf7901ca124c76a6c1cfb0c3b161c8ad7d2)

        • tajo-storage/tajo-storage-common/src/test/java/org/apache/tajo/storage/TestTupleComparator.java
        • tajo-plan/src/main/java/org/apache/tajo/plan/logical/SortNode.java
        • tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/BaseTupleComparator.java
        • CHANGES
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Tajo-master-CODEGEN-build #587 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/587/ ) TAJO-1972 : Invalid sort order with NULLS FIRST|LAST. (jihoonson: rev 46bc8bf7901ca124c76a6c1cfb0c3b161c8ad7d2) tajo-storage/tajo-storage-common/src/test/java/org/apache/tajo/storage/TestTupleComparator.java tajo-plan/src/main/java/org/apache/tajo/plan/logical/SortNode.java tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/BaseTupleComparator.java CHANGES
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/tajo/pull/857

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/857
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jihoonson commented on the pull request:

        https://github.com/apache/tajo/pull/857#issuecomment-155017205

        @jinossy, thank you for quick review!

        Show
        githubbot ASF GitHub Bot added a comment - Github user jihoonson commented on the pull request: https://github.com/apache/tajo/pull/857#issuecomment-155017205 @jinossy, thank you for quick review!
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jinossy commented on the pull request:

        https://github.com/apache/tajo/pull/857#issuecomment-155011477

        +1 LGTM!
        Ship it!

        Show
        githubbot ASF GitHub Bot added a comment - Github user jinossy commented on the pull request: https://github.com/apache/tajo/pull/857#issuecomment-155011477 +1 LGTM! Ship it!
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user jihoonson opened a pull request:

        https://github.com/apache/tajo/pull/857

        TAJO-1972: Invalid sort order with NULLS FIRST|LAST

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/jihoonson/tajo-2 TAJO-1972

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/tajo/pull/857.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #857


        commit 6c0ed3f3d4accb3342f2adf5a7b780902f59404b
        Author: Jihoon Son <jihoonson@apache.org>
        Date: 2015-11-09T05:24:02Z

        Fix sort order


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user jihoonson opened a pull request: https://github.com/apache/tajo/pull/857 TAJO-1972 : Invalid sort order with NULLS FIRST|LAST You can merge this pull request into a Git repository by running: $ git pull https://github.com/jihoonson/tajo-2 TAJO-1972 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/857.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #857 commit 6c0ed3f3d4accb3342f2adf5a7b780902f59404b Author: Jihoon Son <jihoonson@apache.org> Date: 2015-11-09T05:24:02Z Fix sort order

          People

          • Assignee:
            jihoonson Jihoon Son
            Reporter:
            jihoonson Jihoon Son
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development