Skip to content

Instantly share code, notes, and snippets.

@hadoopsters
Last active April 26, 2018 07:27
Show Gist options
  • Save hadoopsters/889a956bad1d2e4743be626f685f9690 to your computer and use it in GitHub Desktop.
Save hadoopsters/889a956bad1d2e4743be626f685f9690 to your computer and use it in GitHub Desktop.
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