Is it possible to export data from HIVE table directly into csv file including headers?
4 Answer(s)
DeZyre Support
hi Trinadh,
It is possible to export hive table data to csv, try the following
hive -e 'select books from table' | sed 's/[[:space:]]\+/,/g' > /home/lvermeer/temp.csv
Dec 01 2015 08:29 PM
It is possible to export hive table data to csv, try the following
hive -e 'select books from table' | sed 's/[[:space:]]\+/,/g' > /home/lvermeer/temp.csv
DeZyre Support
you can also try this
set hive.io.output.fileformat = CSVTextFile;
INSERT OVERWRITE LOCAL DIRECTORY 'dir_path' SELECT FIELD1, FIELD2, FIELD3 FROM TABLE1;
Dec 01 2015 08:30 PM
set hive.io.output.fileformat = CSVTextFile;
INSERT OVERWRITE LOCAL DIRECTORY 'dir_path' SELECT FIELD1, FIELD2, FIELD3 FROM TABLE1;