How to export hive table
In order to download hive table as csv file, we can do the following
so add below property in the command
set hive.cli.print.header=true
Full command below
hive -e 'set hive.cli.print.header=true;use India; select * from Tamilnadu' | sed 's/[\t]/,/g' > /yourlocalpath/yourfile.csv
1.added header by using property
2.chosen the table using query
3.replaced tab delimiter with comma delimiter to make it as csv(comma seperated values)
No comments:
Post a Comment