1.通过hadoop取数据
hadoop fs -get /user/hive/warehouse/AREA/201112/area_20111210.txt /tmp/
把文件area_20111210.txt从hadoop上取到本地路径tmp
2.通过hive
hive> INSERT OVERWRITE LOCAL DIRECTORY '/tmp/aa' select * from area;
Total MapReduce jobs = 1
Launching Job 1 out of 1
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_201112161702_0317, Tracking URL =
Kill Command = /data/hadoop-0.20.2/bin/../bin/hadoop job -Dmapred.job.tracker=192.168.239.63:9001 -kill job_201112161702_0317
3.直接执行
echo "select * from area limit 1000;" | hive > test.txt
阅读(2751) | 评论(0) | 转发(0) |