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

Hive Tutorial 24 : MR vs Tez execution engines in Hive

Unix Tutorial 16 : Command Line Arguments

Unix Tutorial 12 : Loop Types