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

Keep command execution even with errors.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.0
    • Component/s: None
    • Labels:
      None

      Description

      Found this while working on TAJO-1159.

      See the below example, which basically shows entering 2 SQL statements in one line.

      ex)
      jungjw$ $TAJO_HOME/bin/tsql

      Try ? for help.
      default> select * from table1; select * from table2;
      ERROR: relation "default.table1" does not exist
      default>

      As you can see, I'm not seeing the error message for "select * from table2" statement. I don't know yet whether the statement itself is completely ignored or tsql is just showing only one error message here, though. I'm guessing that tsql stops executing following statements if it runs into an error.

      Will take a closer look after resolving other issues.

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user gyias opened a pull request:

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

        TAJO-1183: Keep command execution even with errors

        Fixes TAJO-1183 by making tsql execute all parsed commands even if it
        runs into errors in the middle.

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

        $ git pull https://github.com/gyias/tajo error

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

        https://github.com/apache/tajo/pull/266.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 #266


        commit 64da5df6191e25f9215ce84d3d5f410d21c0d84e
        Author: Jaewoong Jung <jungjw@gmail.com>
        Date: 2014-11-21T07:58:51Z

        TAJO-1183: Keep command execution even with errors

        Fixes TAJO-1183 by making tsql execute all parsed commands even if it
        runs into errors in the middle.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user gyias opened a pull request: https://github.com/apache/tajo/pull/266 TAJO-1183 : Keep command execution even with errors Fixes TAJO-1183 by making tsql execute all parsed commands even if it runs into errors in the middle. You can merge this pull request into a Git repository by running: $ git pull https://github.com/gyias/tajo error Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/266.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 #266 commit 64da5df6191e25f9215ce84d3d5f410d21c0d84e Author: Jaewoong Jung <jungjw@gmail.com> Date: 2014-11-21T07:58:51Z TAJO-1183 : Keep command execution even with errors Fixes TAJO-1183 by making tsql execute all parsed commands even if it runs into errors in the middle.
        Hide
        hyunsik Hyunsik Choi added a comment - - edited

        Hi Jaewoong Jung,

        +1

        I'm sorry for late review. The patch looks good to me. I just tested your patch on my machine. It works well.

        cat > test.sql
        \set ON_ERROR_STOP true
        select * from tablex1;select * from tablex2;
        <ctrl +d>
        
        $ bin/tsql -f test.sql 
        2014-12-03 15:26:36.048 java[8598:1065201] Unable to load realm info from SCDynamicStore
        ERROR: relation "default.table1" does not exist
        
        $ cat > test.sql
        select * from tablex1;select * from tablex2;
        <ctrl +d>
        
        $ bin/tsql -f test.sql 
        2014-12-03 15:24:17.733 java[8373:1063964] Unable to load realm info from SCDynamicStore
        ERROR: relation "default.table1" does not exist
        ERROR: relation "default.table2" does not exist
        
        $ bin/tsql
        default> select * from table2; select * from table3;
        ERROR: relation "default.table2" does not exist
        ERROR: relation "default.table3" does not exist
        
        Show
        hyunsik Hyunsik Choi added a comment - - edited Hi Jaewoong Jung , +1 I'm sorry for late review. The patch looks good to me. I just tested your patch on my machine. It works well. cat > test.sql \set ON_ERROR_STOP true select * from tablex1;select * from tablex2; <ctrl +d> $ bin/tsql -f test.sql 2014-12-03 15:26:36.048 java[8598:1065201] Unable to load realm info from SCDynamicStore ERROR: relation "default.table1" does not exist $ cat > test.sql select * from tablex1;select * from tablex2; <ctrl +d> $ bin/tsql -f test.sql 2014-12-03 15:24:17.733 java[8373:1063964] Unable to load realm info from SCDynamicStore ERROR: relation "default.table1" does not exist ERROR: relation "default.table2" does not exist $ bin/tsql default> select * from table2; select * from table3; ERROR: relation "default.table2" does not exist ERROR: relation "default.table3" does not exist
        Hide
        hyunsik Hyunsik Choi added a comment -

        I've changed the issue title to one you wrote in github PR.

        Show
        hyunsik Hyunsik Choi added a comment - I've changed the issue title to one you wrote in github PR.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

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

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

        I just committed the patch to master branch.

        Show
        hyunsik Hyunsik Choi added a comment - I just committed the patch to master branch.
        Hide
        jungjw Jaewoong Jung added a comment -

        Cool, thanks!

        Show
        jungjw Jaewoong Jung added a comment - Cool, thanks!
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #475 (See https://builds.apache.org/job/Tajo-master-build/475/)
        TAJO-1183: Keep command execution even with errors. (Jaewoong Jung via hyunsik) (hyunsik: rev 5066ac3e80da390ff0f5733d345cbc63ec252843)

        • CHANGES
        • tajo-client/src/main/java/org/apache/tajo/cli/tsql/TajoCli.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #475 (See https://builds.apache.org/job/Tajo-master-build/475/ ) TAJO-1183 : Keep command execution even with errors. (Jaewoong Jung via hyunsik) (hyunsik: rev 5066ac3e80da390ff0f5733d345cbc63ec252843) CHANGES tajo-client/src/main/java/org/apache/tajo/cli/tsql/TajoCli.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Tajo-master-CODEGEN-build #116 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/116/)
        TAJO-1183: Keep command execution even with errors. (Jaewoong Jung via hyunsik) (hyunsik: rev 5066ac3e80da390ff0f5733d345cbc63ec252843)

        • tajo-client/src/main/java/org/apache/tajo/cli/tsql/TajoCli.java
        • CHANGES
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Tajo-master-CODEGEN-build #116 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/116/ ) TAJO-1183 : Keep command execution even with errors. (Jaewoong Jung via hyunsik) (hyunsik: rev 5066ac3e80da390ff0f5733d345cbc63ec252843) tajo-client/src/main/java/org/apache/tajo/cli/tsql/TajoCli.java CHANGES

          People

          • Assignee:
            jungjw Jaewoong Jung
            Reporter:
            jungjw Jaewoong Jung
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development