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

stephen sprague commented on HIVE-14525:
----------------------------------------

Hi Miklos,
Thanks for the quick work on patching this up!

I haven't had a chance yet to look at your patch yet but that said i did 
encounter some other twists wrt to reading from stdin - and then what happens 
on stdout.  Figured it be good to get your thoughts.


case #1.  -f switch.   consistent with above problem i described.  you may have 
fixed this though it is using the -f switch and not stdin in this case.
{quote}
    $ cat test.sql
select
"foo",
"bar"
;
   $  beeline -u dwrdevnn1 --showheader=false --outputformat=tsv2 >stdout 
2>stderr -f test.sql    #-f switch
   $ cat stdout
0: jdbc:hive2://dwrdevnn1.sv2.trulia.com:1000> select
. . . . . . . . . . . . . . . . . . . . . . .> "foo",
. . . . . . . . . . . . . . . . . . . . . . .> "bar"
. . . . . . . . . . . . . . . . . . . . . . .> ;
foo     bar
0: jdbc:hive2://dwrdevnn1.sv2.trulia.com:1000>
0: jdbc:hive2://dwrdevnn1.sv2.trulia.com:1000>
{quote}



case #2 . stdin  .  In this case EVEN THE REAL OUTPUT has ". . . . . ."  in 
front of it - unlike case #1 above.

{quote}
$ echo -e 'select\n"foo",\n"bar"' |  beeline -u dwrdevnn1 --showheader=false 
--outputformat=tsv2 >stdout 2>stderr
0: jdbc:hive2://dwrdevnn1.sv2.trulia.com:1000> select
. . . . . . . . . . . . . . . . . . . . . . .> "foo",
. . . . . . . . . . . . . . . . . . . . . . .> "bar"
. . . . . . . . . . . . . . . . . . . . . . .> foo      bar
0: jdbc:hive2://dwrdevnn1.sv2.trulia.com:1000>
{quote}

case #3   -  when beeline run from cron (or in a case where there is no tty)  I 
simulate this by ssh'ing to localhost and running query.

{quote}
$ cat test1.sh
#!/bin/bash
beeline -u dwrdevnn1 --showheader=false --outputformat=tsv2 >stdout 2>stderr 
<<SQL
select
"foo",
"bar"
;
SQL

$ ssh localhost "test1.sh"

$ cat stdout
0: jdbc:hive2://dwrdevnn1.sv2.trulia.com:1000> . . . . . . . . . . . . . . . . 
. . . . . . .> . . . . . . . . . . . . . . . . . . . . . . .> . . . . . . . . . 
. . . . . . . . . . . . . .> foo        bar
0: jdbc:hive2://dwrdevnn1.sv2.trulia.com:1000>

(all newlines are gone. and the echo'ing of the actual SQL is missing - so all 
you get are the two different kinds of prefixes. )
{quote}

i'll review you patch probably tomorrow but wanted to get you this information 
now.  case #3 (running from cron) is the kicker we just ran into today.

thanks again Miklos.


> beeline still writing log data to stdout as of version 2.1.0
> ------------------------------------------------------------
>
>                 Key: HIVE-14525
>                 URL: https://issues.apache.org/jira/browse/HIVE-14525
>             Project: Hive
>          Issue Type: Bug
>          Components: Beeline
>    Affects Versions: 2.1.0, 2.2.0
>            Reporter: stephen sprague
>            Assignee: Miklos Csanady
>              Labels: beeline
>         Attachments: HIVE-14525.1.patch, HIVE-14525.2.patch, 
> HIVE-14525.3.patch, HIVE-14525.4.patch, HIVE-14525.patch
>
>
> simple test. note that i'm looking to get a tsv file back.
> {code}
> $ beeline -u dwrdevnn1 --showHeader=false --outputformat=tsv2 <<SQL >stdout 
> 2>stderr
> > select count(*)
> > from default.dual;
> > SQL
> {code}
> instead i get this in stdout:
> {code}
> $ cat stdout
> 0: jdbc:hive2://dwrdevnn1.sv2.trulia.com:1000> select count(*)
> . . . . . . . . . . . . . . . . . . . . . . .> from default.dual;
> 0
> 0: jdbc:hive2://dwrdevnn1.sv2.trulia.com:1000> 
> {code}
> i should only get one row which is the *result* of the query (which is 0) - 
> not the ovthe loggy kind of lines you see above. that stuff goes to stderr my 
> friends.
> also i refer to this ticket b/c the last comment suggested so - its close but 
> not exactly the same.
> https://issues.apache.org/jira/browse/HIVE-14183



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

Reply via email to