Hive导出为csv格式到本地文件系统
- 语句中$表示可替换变量
- 如有分隔符需要替换,建议用sed,例如:sed -i ‘s/\t/;/g’ res2.csv
1 |
hive -e "select ... from $databaseName.$tableName where ..." >> $outFileName.csv |
1 |
hive -e "select ... from $databaseName.$tableName where ..." >> $outFileName.csv |