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

Himanshu Mishra commented on HIVE-22056:
----------------------------------------

Sorry I didn't run the unit test locally.

The unit test checks that shell commands should run even with failed 
connection, but it tests only for script file provided with -f argument, 
running same command with -e option also throws error.
{code:java}
❯ bin/beeline -e '!sh echo hello world'
Cannot run commands specified using -e. No current connection
{code}
The issue here is we check that that whether connection was successful or not 
for throwing error, and not whether connection was required.

Updating the patch to check for whether we have URL either via argument or for 
default connection before throwing the error.

 

> Beeline started with -f <script-file>, exit code is 0 even if unable to 
> connect to HS2
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-22056
>                 URL: https://issues.apache.org/jira/browse/HIVE-22056
>             Project: Hive
>          Issue Type: Bug
>          Components: Beeline
>    Affects Versions: 3.1.0, 4.0.0, 3.1.1
>            Reporter: Himanshu Mishra
>            Assignee: Himanshu Mishra
>            Priority: Major
>             Fix For: 4.0.0
>
>         Attachments: HIVE-22056.patch
>
>
> When Beeline in hive 3 is started with -f <script-file> argument, even if it 
> is not able to connect to HS2 server, it exits with success code i.e. 0. 
> Looks like this bug got introduced with the fix for HIVE-19744
>  In previous versions it used to exit with code 2, fixing by exiting with 
> same code.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to