1.用insert,写到hdfs目录下,但是目录好像要由hive用户创建才可以,否则会报错
INSERT OVERWRITE DIRECTORY '/tmp/test1029_tmp' ROW FORMAT DELIMITED FIELDS TERMINATED by ',' select * from bank_info;
+----------+-------+-----------+--------+------------+----------+
| acc_num | name | password | email | cellphone | balance |
+----------+-------+-----------+--------+------------+----------+
+----------+-------+-----------+--------+------------+----------+
No rows selected (0.947 seconds)
2.beeline客户端查询后写到本地
beeline -u jdbc:hive2://localhost:10000/ana --silent=true --outputformat=csv --showHeader=false -e "select a.* from last_30day limit 10" > out.csv
————————————————
版权声明:本文为CSDN博主「oppo62258801」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/oppo62258801/article/details/102820534