Created
May 20, 2014 06:49
-
-
Save sankars/210ab04a030cfbcbd9f7 to your computer and use it in GitHub Desktop.
Hive Commands that uses HDFS for storage
This file contains hidden or 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
-- http://stackoverflow.com/questions/18129581/how-do-i-output-the-results-of-a-hiveql-query-to-csv | |
INSERT OVERWRITE LOCAL DIRECTORY '/target/directory/' select books from table; -- writes to local file system | |
INSERT OVERWRITE DIRECTORY '/target/directory/' select books from table; -- writes to HDFS. column seperator -> ^A row -> /n | |
hive -e 'select books from table' > /target/directory/file.tsv -- to local file system | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment