hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chaoyu Tang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-10541) Beeline requires newline at the end of each query in a file
Date Thu, 30 Apr 2015 03:15:06 GMT

    [ 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)

Mime
View raw message