Description
use default; create table clitest (key int, name String, value String); insert into table clitest values (1,"TRUE","1"),(2,"TRUE","1"),(3,"TRUE","1"),(4,"TRUE","1"),(5,"FALSE","0"),(6,"FALSE","0"),(7,"FALSE","0");
then run a select query
# cat /tmp/select.sql
set hive.execution.engine=mr;
select key,name,value
from clitest
where value="1" limit 1;
Then run beeline via a remote shell, for example
$ ssh -l root <remotehost.domain.com> "sudo -u hive beeline -u jdbc:hive2://localhost:10000 -n hive -p hive --silent=true --outputformat=csv2 -f /tmp/select.sql" root@<remoteHost.domain.com>'s password: 16/07/12 14:59:22 WARN mapreduce.TableMapReduceUtil: The hbase-prefix-tree module jar containing PrefixTreeCodec is not present. Continuing without it. nullkey,name,value 1,TRUE,1 null $
In older releases that the output is as follows
$ ssh -l root <remoteHost.domain.com> "sudo -u hive beeline -u jdbc:hive2://localhost:10000 -n hive -p hive --silent=true --outputformat=csv2 -f /tmp/run.sql" Are you sure you want to continue connecting (yes/no)? yes root@<remoteHost.domain.com>'s password: 16/07/12 14:57:55 WARN mapreduce.TableMapReduceUtil: The hbase-prefix-tree module jar containing PrefixTreeCodec is not present. Continuing without it. key,name,value 1,TRUE,1 $
The output contains nulls instead of blank lines. This is due to the use of -Djline.terminal=jline.UnsupportedTerminal introduced in HIVE-6758 to be able to run beeline as a background process. But this is the unfortunate side effect of that fix.
Running beeline in background also produces garbled output.
# beeline -u "jdbc:hive2://localhost:10000" -n hive -p hive --silent=true --outputformat=csv2 --showHeader=false -f /tmp/run.sql 2>&1 > /tmp/beeline.txt &
# cat /tmp/beeline.txt
null1,TRUE,1
#
So I think the use of jline.UnsupportedTerminal should be documented but not used automatically by beeline under the covers.
Attachments
Attachments
Issue Links
- is broken by
-
HIVE-6758 Beeline doesn't work with -e option when started in background
- Closed