You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Zhihua Deng (Jira)" <ji...@apache.org> on 2021/09/23 08:04:00 UTC

[jira] [Commented] (HIVE-25537) Last Executed query exit status

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

Zhihua Deng commented on HIVE-25537:
------------------------------------

Use beeline -f or beeline -e can stop running subsequent queries if one if failed.

> Last Executed query exit status
> -------------------------------
>
>                 Key: HIVE-25537
>                 URL: https://issues.apache.org/jira/browse/HIVE-25537
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Sai Teja Manchi
>            Priority: Major
>
> Is there any way to get status of the Last executed query from beeline?
>  
> Why is it needed?
> We're trying to execute queries from a shell script(input redirection) and want to stop execution if any query fails.
> Following is an example:
> beeline << EOF
> select * from table1;
> select * from table2;
> EOF
>  
> In the above case if query 1 fails we want to stop running subsequent queries.
>  
> Although we can check exit status after closing session in the following way.
> beeline << EOF
> select * from table1;
> EOF
> EXIT_STATUS=$?
> if[ $EXIT_STATUS -ne 0 ]
> then
> echo "Failed"
> exit $EXIT_STATUS
> fi
>  
> In this case we need to connect to beeline once for each query.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)