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

Jesus Camacho Rodriguez commented on HIVE-11094:
------------------------------------------------

[~thejas], maybe I'm misunderstanding what is considered Beeline "correct" 
behavior here.

I thought that precisely those messages, as they are not errors and just 
information about the execution, should be sent to the info stream and be 
redirected to the file too. If the user does not want to print them, he could 
use the silent option provided by beeline.

To see that actually those messages are sent to the error stream by Beeline, 
you can redirect the error stream to another file (2>):

{noformat}
jcamachguezrMBP:apache-hive-2.0.0-SNAPSHOT-bin jcamachorodriguez$ bin/beeline 
-u jdbc:hive2:// -e "show databases" > exec.out 2> error.out


jcamachguezrMBP:apache-hive-2.0.0-SNAPSHOT-bin jcamachorodriguez$ cat exec.out
+----------------+--+
| database_name  |
+----------------+--+
| default        |
| tpcds          |
+----------------+--+


jcamachguezrMBP:apache-hive-2.0.0-SNAPSHOT-bin jcamachorodriguez$ cat error.out
Connecting to jdbc:hive2://
15/06/26 05:26:17 [main]: WARN util.NativeCodeLoader: Unable to load 
native-hadoop library for your platform... using builtin-java classes where 
applicable
Connected to: Apache Hive (version 2.0.0-SNAPSHOT)
Driver: Hive JDBC (version 2.0.0-SNAPSHOT)
Transaction isolation: TRANSACTION_REPEATABLE_READ
OK
2 rows selected (1.775 seconds)
Beeline version 2.0.0-SNAPSHOT by Apache Hive
Closing: 0: jdbc:hive2://
{noformat}

> Beeline redirecting all output to ErrorStream
> ---------------------------------------------
>
>                 Key: HIVE-11094
>                 URL: https://issues.apache.org/jira/browse/HIVE-11094
>             Project: Hive
>          Issue Type: Bug
>          Components: CLI
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>         Attachments: HIVE-11094.patch
>
>
> Beeline is sending all output to ErrorStream, instead of using OutputStream 
> for info or debug information.
> The problem can be reproduced by running:
> {noformat}
> ./bin/beeline -u jdbc:hive2:// -e "show databases" > exec.out
> {noformat}
> I will still print the output through the terminal. The reason seems to be 
> that the normal output is also sent through the ErrorStream.



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

Reply via email to