命令
hive -e "set hive.cli.print.header=true; #将表头输出 select * from data_table where some_query_conditions" | sed 's/[\t]/,/g' > hhd.csv
set hive.cli.print.header=true将表头输出;sed 's/[\t]/,/g' 将\t替换成,> 将shell里打印的内容输出到文件
set hive.cli.print.header=true
sed 's/[\t]/,/g'
\t
,
>
shell
原文链接:http://www.cnblogs.com/feiquan/p/11338126.html
本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728