Kunal Deep
Kunal Deep

Reputation: 5

Custom delimiter while exporting hive table to CSV from shell command line?

I use the following command and the file I get in CSV is tab delimited.

hive -e "select * from my_table_name" > my_csv_file_received_daily.csv

And I have to reformat the files everytime. Is there a simple way to change this commance to get a comma delimited file instead of tab.

Upvotes: 0

Views: 817

Answers (1)

David דודו Markovitz
David דודו Markovitz

Reputation: 44911

insert overwrite local directory 'my_csv_file_received_daily'
row format delimited 
fields terminated by ',' 
select * from my_table_name
;

Upvotes: 1

Related Questions