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\'
hive --outputformat=csv2 -e "select * from yourtable" > my_file.csv
or
hive --outputformat=csv2 -e "select * from yourtable" > [your_path]/file_name.csv
For tsv, just change csv to tsv in the above queries and run your queries