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

sort operator after Inline views consisting of unions can cause an incorrect distributed plan

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0
    • Component/s: distributed query plan
    • Labels:
      None

      Description

      See the title. The following query is an example of this bug.

      SELECT
        l_returnflag,
        l_linestatus
      
      FROM (
        SELECT
          *
        FROM
          lineitem
        WHERE
          l_returnflag = 'O'
      
        UNION ALL
      
        SELECT
          *
        FROM
          lineitem
        WHERE
          l_returnflag = 'R'
      ) T
      
      GROUP BY
        l_returnflag,
        l_linestatus
      
      ORDER BY
        l_returnflag,
        l_linestatus
      

      This patch adds an unit test to reproduce this case and includes the bug fix.

      1. TAJO-418.patch
        4 kB
        Hyunsik Choi

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-trunk-postcommit #624 (See https://builds.apache.org/job/Tajo-trunk-postcommit/624/)
        TAJO-418: sort operator after Inline views consisting of unions can cause an incorrect distributed plan. (hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=d930a90d50ce9b41050486ace11c96d0847b80b0)

        • tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestCaseByCases.java
        • tajo-core/tajo-core-backend/src/test/queries/tajo418_case.sql
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java
        • CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-trunk-postcommit #624 (See https://builds.apache.org/job/Tajo-trunk-postcommit/624/ ) TAJO-418 : sort operator after Inline views consisting of unions can cause an incorrect distributed plan. (hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=d930a90d50ce9b41050486ace11c96d0847b80b0 ) tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestCaseByCases.java tajo-core/tajo-core-backend/src/test/queries/tajo418_case.sql tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java CHANGES.txt
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed it to master. Thanks for the review.

        Show
        hyunsik Hyunsik Choi added a comment - committed it to master. Thanks for the review.
        Hide
        blrunner Jaehwa Jung added a comment -

        +1 for the patch.
        'mvn clean install' finished successfully.

        Show
        blrunner Jaehwa Jung added a comment - +1 for the patch. 'mvn clean install' finished successfully.
        Hide
        hyunsik Hyunsik Choi added a comment -

        This bug was caused by building an wrong logical plan in GlobalPlanner::buildSortPlan().

        Show
        hyunsik Hyunsik Choi added a comment - This bug was caused by building an wrong logical plan in GlobalPlanner::buildSortPlan().

          People

          • Assignee:
            hyunsik Hyunsik Choi
            Reporter:
            hyunsik Hyunsik Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development