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

Bharathkrishna Guruvayoor Murali commented on HIVE-19048:
---------------------------------------------------------

I performed the following command and noting the results below:
{code:java}
$ cat init.sql
invalid;
select 1;
{code}
{code:java}
$ ./beeline -u jdbc:hive2://localhost:10000/ -n hive -i init.sql --force=true
0: jdbc:hive2://localhost:10000/> invalid;
Error: Error while compiling statement: FAILED: ParseException line 1:0 cannot 
recognize input near 'invalid' '<EOF>' '<EOF>' (state=42000,code=40000)
0: jdbc:hive2://localhost:10000/> select 1;
[...]
+------+
| _c0 |
+------+
| 1 |
+------+
1 row selected (0.32 seconds)
{code}
When I gave the --force option as true, both statements in the init.sql file 
were executed.

If the --force option is not used(which defaults to false), only the first 
statement in init.sql is executed and it does not proceed after the error in 
the first statement.

 

Can you please share the exact command you used with --force option where it 
did not execute all the lines after the error occurred?

> Initscript errors are ignored
> -----------------------------
>
>                 Key: HIVE-19048
>                 URL: https://issues.apache.org/jira/browse/HIVE-19048
>             Project: Hive
>          Issue Type: Bug
>          Components: Beeline
>            Reporter: Zoltan Haindrich
>            Assignee: Bharathkrishna Guruvayoor Murali
>            Priority: Major
>
> I've been running some queries for a while when I've noticed that my 
> initscript has an error; and beeline stops interpreting the initscript after 
> encountering the first error.
> {code}
> echo 'invalid;' > init.sql
> echo 'select 1;' > s1.sql
> beeline -u jdbc:hive2://localhost:10000/ -n hive -i init.sql -f s1.sql 
> [...]
> Running init script init.sql
> 0: jdbc:hive2://localhost:10000/> invalid;
> Error: Error while compiling statement: FAILED: ParseException line 1:0 
> cannot recognize input near 'invalid' '<EOF>' '<EOF>' (state=42000,code=40000)
> 0: jdbc:hive2://localhost:10000/> select 1;
> [...]
> $ echo $?
> 0
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to