hive -e "set hive.cli.print.header=true; select * from userdb.employees2" | sed 's/[\t]/,/g' > hhd.csv
set hive.cli.print.header=true能将表头输出;
sed ‘s/[\t]/,/g’ 将\t替换成,
将shell里打印的内容输出到文件
hive -e "set hive.cli.print.header=true; select * from userdb.employees2" | sed 's/[\t]/,/g' > hhd.csv
set hive.cli.print.header=true能将表头输出;
sed ‘s/[\t]/,/g’ 将\t替换成,
将shell里打印的内容输出到文件