Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print hive beeline output without header and non tabular form

I want to print this output

+------------------------------------------------+--+
|                    tab_name                    |
+------------------------------------------------+--+
| table1                                         |
| table2                                         |
| table3                                         |
| wt                                             |
| wa                                             |
| wal                                            |
+------------------------------------------------+--+

AS without header and without table format in beeline

table1
table2 table3 wt
wa
wal

like image 848
sande Avatar asked Apr 24 '17 19:04

sande


People also ask

How do I remove a beeline header?

You can use argument --showHeader=false --outputformat=tsv2 to illuminate this. Your data will look like this. Do remember these three are enabled with single quotes around the value if values are having special char or new line within. Quoting can be disabled by setting the disable.quoting.for.sv to true.

How do I redirect Hive query output to a file?

To directly save the file in HDFS, use the below command: hive> insert overwrite directory '/user/cloudera/Sample' row format delimited fields terminated by '\t' stored as textfile select * from table where id >100; This will put the contents in the folder /user/cloudera/Sample in HDFS. Show activity on this post.

How do you open a beeline shell?

To start Beeline, run beeline shell which is located at $HIVE_HOME/bin directory. This prompts you to an interactive Hive Beeline CLI Shell where you can run HiveQL commands. You can enter !


1 Answers

From the shell

beeline --showHeader=false --outputformat=tsv2 -e "select ..."

Within beeline

!set showheader false
!set outputformat tsv2    
select ...;
like image 76
David דודו Markovitz Avatar answered Oct 20 '22 00:10

David דודו Markovitz