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

Chaoyu Tang commented on HIVE-10541:
------------------------------------

It looks like a bug from jline (jline-2.1.2.jar), class 
jline.console.ConsoleReader.java method:
public String readLine(String prompt, final Character mask) throws IOException
{code}
                int c = pushBackChar.isEmpty() ? readCharacter() : 
pushBackChar.pop ();
                if (c == -1) {
                    return null;
                }
{code}
When reaching the end of line without \n, readCharacter returns -1 and readLine 
discard what it has read and return null. so the last command in sql script 
passed via -f will be ignored. 
It can be worked around by append a newline after the last sql command.


> Beeline requires newline at the end of each query in a file
> -----------------------------------------------------------
>
>                 Key: HIVE-10541
>                 URL: https://issues.apache.org/jira/browse/HIVE-10541
>             Project: Hive
>          Issue Type: Bug
>          Components: Beeline
>    Affects Versions: 0.13.1
>            Reporter: Chaoyu Tang
>            Assignee: Chaoyu Tang
>            Priority: Minor
>
> Beeline requires newline at the end of each query in a file.



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

Reply via email to