Using Hive I would like to get the result of a query inside a csv file, I would also like to get the header.
To achieve this I'm executing:
hive -e '
use database;
set hive.cli.print.header=true;
select * from table;
' > /home/centos/user/result.csv
But the first line of the csv is:
table.field1_name,table.field2_name,table.field3_name
How can I get insead:
field1_name,field2_name,field3_name
I just needed to add:
set hive.resultset.use.unique.column.names=false;
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