I would use this: hive -S -e "SELECT some_field FROM some_table"|sed "s/,/_/"|sed "s/\t/,/">some.csv
On Sun, Sep 23, 2012 at 11:14 AM, zuohua zhang <zuo...@gmail.com> wrote: > I tried the following: > > CREATE TABLE test > ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' > STORED AS TEXTFILE > AS > select > * > from > test_new; > > set hive.io.output.fileformat=CSVTextFile; > INSERT OVERWRITE DIRECTORY '/test' > select * from test; > > > hadoop dfs -getmerge /test /mnt/test > > when I check my /mnt/test, it shows with \A as delimiter not , > > How to fix? > > Most importantly, some of the fields has , in them, so the proper csv format > would be "day1, day2", how to achieve that? > > Thanks!