Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4914299
  • 博文数量: 998
  • 博客积分: 8199
  • 博客等级: 中将
  • 技术积分: 13042
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-25 20:19
个人简介

脚踏实地、勇往直前!

文章分类

全部博文(998)

文章存档

2019年(88)

2018年(208)

2017年(81)

2016年(49)

2015年(50)

2014年(170)

2013年(52)

2012年(177)

2011年(93)

2010年(30)

分类: HADOOP

2014-10-30 10:48:09


导出到本地系统

将hive表数据导出到os目录/home/hadoop1/file/from_hive,导出后会在tb_emp_info目录下生成文件名为000000_0的文件,好像不能指定具体的文件名导出
hive> insert overwrite local directory '/home/hadoop1/file/tb_emp_info' select * from tb_emp_info;


导出到hdfs系统

hive> insert overwrite directory '/home/hadoop1/hive_output/tb_emp_info' select * from tb_emp_info;
Total MapReduce jobs = 2
Launching Job 1 out of 2
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_201410300915_0003, Tracking URL = http://node1:50030/jobdetails.jsp?jobid=job_201410300915_0003
Kill Command = /usr1/hadoop/libexec/../bin/hadoop job  -Dmapred.job.tracker=http://192.168.56.101:9001 -kill job_201410300915_0003
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0
2014-10-30 10:35:42,580 Stage-1 map = 0%,  reduce = 0%
2014-10-30 10:35:44,595 Stage-1 map = 100%,  reduce = 0%, Cumulative CPU 0.38 sec
2014-10-30 10:35:45,603 Stage-1 map = 100%,  reduce = 100%, Cumulative CPU 0.38 sec
MapReduce Total cumulative CPU time: 380 msec
Ended Job = job_201410300915_0003
Ended Job = -926438869, job is filtered out (removed at runtime).
Moving data to: hdfs://192.168.56.101:9000/tmp/hive-hadoop1/hive_2014-10-30_10-35-38_612_6377994640941387871/-ext-10000
Moving data to: /home/hadoop1/hive_output/tb_emp_info
Failed with exception Unable to rename: hdfs://192.168.56.101:9000/tmp/hive-hadoop1/hive_2014-10-30_10-35-38_612_6377994640941387871/-ext-10000 to: /home/hadoop1/hive_output/tb_emp_info
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
MapReduce Jobs Launched:
Job 0: Map: 1   Cumulative CPU: 0.38 sec   HDFS Read: 768 HDFS Write: 428 SUCCESS
Total MapReduce CPU Time Spent: 380 msec

解决办法:     
将hive.insert.into.multilevel.dirs参数的值由默认的false修改为true
 
  hive.insert.into.multilevel.dirs 
  true 
 

-- The End --

阅读(4690) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
请登录后评论。

登录 注册