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

boolean test does not work correctly

    Details

      Description

      The current parser does not parse boolean_test correctly. So, it leads to wrong results as follows:

      select 1 < 3 is false;
      t
      
      1. TAJO-272_2.patch
        3 kB
        Hyunsik Choi
      2. TAJO-272.patch
        7 kB
        Hyunsik Choi

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-trunk-postcommit #526 (See https://builds.apache.org/job/Tajo-trunk-postcommit/526/)
        TAJO-272: boolean test does not work correctly. (hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=77eff67b043d30813314b13b255b647cec6f529a)

        • tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/eval/TestPredicates.java
        • tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java
        • CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-trunk-postcommit #526 (See https://builds.apache.org/job/Tajo-trunk-postcommit/526/ ) TAJO-272 : boolean test does not work correctly. (hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=77eff67b043d30813314b13b255b647cec6f529a ) tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/eval/TestPredicates.java tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java CHANGES.txt
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed it to master and branch-0.2. Thank you for the fast review.

        Show
        hyunsik Hyunsik Choi added a comment - committed it to master and branch-0.2. Thank you for the fast review.
        Hide
        jhkim Jinho Kim added a comment -

        +1
        Great!! I've verified 'mvn clean install'.

        Show
        jhkim Jinho Kim added a comment - +1 Great!! I've verified 'mvn clean install'.
        Hide
        hyunsik Hyunsik Choi added a comment -

        I've updated the patch.

        Show
        hyunsik Hyunsik Choi added a comment - I've updated the patch.
        Hide
        hyunsik Hyunsik Choi added a comment -

        This patch fixes the bug and adds various unit test for boolean test as follows:

            testSimpleEval("select 1 < 3 is true", new String [] {"t"});
            testSimpleEval("select 1 < 3 is not true", new String [] {"f"});
            testSimpleEval("select 1 < 3 is false", new String [] {"f"});
            testSimpleEval("select 1 < 3 is not false", new String [] {"t"});
        
            testSimpleEval("select not (1 < 3 is true)", new String [] {"f"});
            testSimpleEval("select not (1 < 3 is not true)", new String [] {"t"});
            testSimpleEval("select not (1 < 3 is false)", new String [] {"t"});
            testSimpleEval("select not (1 < 3 is not false)", new String [] {"f"});
        
            testSimpleEval("select 1 > 3 is true", new String [] {"f"});
            testSimpleEval("select 1 > 3 is not true", new String [] {"t"});
            testSimpleEval("select 1 > 3 is false", new String [] {"t"});
            testSimpleEval("select 1 > 3 is not false", new String [] {"f"});
        
            testSimpleEval("select not (1 > 3 is true)", new String [] {"t"});
            testSimpleEval("select not (1 > 3 is not true)", new String [] {"f"});
            testSimpleEval("select not (1 > 3 is false)", new String [] {"f"});
            testSimpleEval("select not (1 > 3 is not false)", new String [] {"t"});
        
        Show
        hyunsik Hyunsik Choi added a comment - This patch fixes the bug and adds various unit test for boolean test as follows: testSimpleEval( "select 1 < 3 is true " , new String [] { "t" }); testSimpleEval( "select 1 < 3 is not true " , new String [] { "f" }); testSimpleEval( "select 1 < 3 is false " , new String [] { "f" }); testSimpleEval( "select 1 < 3 is not false " , new String [] { "t" }); testSimpleEval( "select not (1 < 3 is true )" , new String [] { "f" }); testSimpleEval( "select not (1 < 3 is not true )" , new String [] { "t" }); testSimpleEval( "select not (1 < 3 is false )" , new String [] { "t" }); testSimpleEval( "select not (1 < 3 is not false )" , new String [] { "f" }); testSimpleEval( "select 1 > 3 is true " , new String [] { "f" }); testSimpleEval( "select 1 > 3 is not true " , new String [] { "t" }); testSimpleEval( "select 1 > 3 is false " , new String [] { "t" }); testSimpleEval( "select 1 > 3 is not false " , new String [] { "f" }); testSimpleEval( "select not (1 > 3 is true )" , new String [] { "t" }); testSimpleEval( "select not (1 > 3 is not true )" , new String [] { "f" }); testSimpleEval( "select not (1 > 3 is false )" , new String [] { "f" }); testSimpleEval( "select not (1 > 3 is not false )" , new String [] { "t" });

          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