Hive Tutorial 35 : Export hive table data into a file


There are couple of ways to do this

Process 1:

hive -e 'select books from table' | sed 's/[[:space:]]\+/,/g' > /home/lvermeer/temp.csv


Process 2 :


INSERT OVERWRITE LOCAL DIRECTORY 'dir_path' SELECT FIELD1, FIELD2, FIELD3 FROM TABLE1;


Comments

Popular posts from this blog

Unix Tutorial 11 : Conditional Statements

Unix Tutorial 12 : Loop Types

Unix Tutorial 17 : Advance Unix