Created
August 16, 2017 22:45
-
-
Save hadoopsters/8995b2bdb0b7f3eef4d229ff74228c64 to your computer and use it in GitHub Desktop.
Export Hive Table to CSV: Method 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
hive -e "drop table if exists csv_dump; | |
create table csv_dump ROW FORMAT DELIMITED | |
FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' | |
LOCATION '/temp/storage/path' as | |
select * from my_data_table;" | |
hadoop fs -getmerge /temp/storage/path/ /local/path/my.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment