[ 
https://issues.apache.org/jira/browse/DRILL-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14545903#comment-14545903
 ] 

Victoria Markman commented on DRILL-3077:
-----------------------------------------

Thank you, Julian.sqlline now returns non zero error code on error (we upgraded 
to 1.1.9)

Summary of the change is: sqlline exits with 0 on success, 1 on invalid 
arguments, and 2 on any other error.

> sqlline's return code is 0 even when it force exits due to failed sql command
> -----------------------------------------------------------------------------
>
>                 Key: DRILL-3077
>                 URL: https://issues.apache.org/jira/browse/DRILL-3077
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Victoria Markman
>
> My SQL script looks like this:
> {code}
> select * from sys.options limit 1;
> select * sys.options; <--- from clause is missing
> select * from sys.options limit 1;
> {code}
> sqlline correctly exists (--force is set to true by default).
> However, return code is '0', which makes scripting challenging.
> It should be set to 1.
> {code}
> [Wed May 13 17:49:39 root@~ ] # ${DRILL_HOME}/bin/sqlline -u 
> "jdbc:drill:schema=dfs.ctas_parquet"  --run=/root/script.sql
> 1/5          select * from sys.options limit 1;
> +------------+------------+------------+------------+------------+------------+------------+------------+
> |    name    |    kind    |    type    |   status   |  num_val   | string_val 
> |  bool_val  | float_val  |
> +------------+------------+------------+------------+------------+------------+------------+------------+
> | drill.exec.rpc.bit.server.retry.delay | LONG       | BOOT       | BOOT      
>  | 500        | null       | null       | null       |
> +------------+------------+------------+------------+------------+------------+------------+------------+
> 1 row selected (0.247 seconds)
> 2/5          
> 3/5          select * sys.options;
> Error: PARSE ERROR: Encountered "." at line 1, column 13.
> Was expecting one of:
>     "FROM" ...
>     "," ...
> [Error Id: 9da00514-6a96-4d9a-b90a-c903d006c060 on atsqa4-133.qa.lab:31010] 
> (state=,code=0)
> Aborting command set because "force" is false and command failed: "select * 
> sys.options;"
> Closing: org.apache.drill.jdbc.DrillJdbc41Factory$DrillJdbc41Connection
> sqlline version 1.1.6
> [Wed May 13 17:53:56 root@~ ] # echo $?
> 0
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to