以csv格式保存hql查询结果

时间:2017-03-18 14:42:53

标签: csv hadoop hql cloudera

这是我用来将查询结果保存到csv文件的代码

hive -e 'select * from twitter.finalcount' > hdfs dfs /user/hue/resutsofquery/finalcount.csv

这是输出:

2017-03-18 07:27:40,810 WARN  [main] mapreduce.TableMapReduceUtil: The hbase-prefix-tree module jar containing PrefixTreeCodec is not present.  Continuing without it.

Logging initialized using configuration in file:/etc/hive/conf.dist/hive-log4j.properties
OK
**Time taken: 49.537 seconds, Fetched: 25363 row(s)**

但是当我检查我的csv文件时,它不在我的目录中(resutsofquery)。我怎么找到它?给我一个很好的解决方案

我也试过这种方式

hive -e 'set hive.cli.print.header=true; SELECT * FROM twitter.finalcount LIMIT 0;' > /user/hue/resutsofquery/file_name.csv

但它会抛出错误

  

bash:/user/hue/resutsofquery/file_name.csv:没有这样的文件或目录

我在终端

中输入此内容

0 个答案:

没有答案