Skip to content

Instantly share code, notes, and snippets.

@hadoopsters

hadoopsters/hiveToCsv_1.sh

Last active Apr 26, 2018
Embed
What would you like to do?
Export Hive Table to CSV: Method 1
#!/bin/bash
hive -e "insert overwrite local directory '/path/in/local/'
row format delimited fields terminated by ','
select * from my_database.my_table"
cat /path/in/local/* > /another/path/in/local/my_table.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment