How do I output the results of a HiveQL query to CSV?

前端 未结 18 1676
独厮守ぢ
独厮守ぢ 2020-11-27 10:11

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\'          


        
18条回答
  •  -上瘾入骨i
    2020-11-27 10:53

    This shell command prints the output format in csv to output.txt without the column headers.

    $ hive --outputformat=csv2 -f 'hivedatascript.hql' --hiveconf hive.cli.print.header=false > output.txt
    

提交回复
热议问题