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
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.
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.
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 !
From the shell
beeline --showHeader=false --outputformat=tsv2 -e "select ..."
Within beeline
!set showheader false
!set outputformat tsv2
select ...;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With