we would like to put the results of a Hive query to a CSV file. I thought the command should look like this:
insert overwrite directory \'/home/output.csv\'
If you want a CSV file then you can modify Lukas' solutions as follows (assuming you are on a linux box):
hive -e 'select books from table' | sed 's/[[:space:]]\+/,/g' > /home/lvermeer/temp.csv