Hive导入sequencefile错误
来源:互联网 发布:各国知乎 编辑:程序博客网 时间:2024/06/06 19:23
本地load data到hive表中,可能会由于一些表格式的问题或文本格式问题,导致上传失败。
总结原因:
1. 上传格式和建表格式不匹配
自己上传的为txt文本,而创建表指定的file format 是sequencefile。
hive> load data local inpath '/home/hadoop/ma_test.txt' into table sep26_ma_deposit_dim;Copying data from file:/home/hadoop/ma_test.txtCopying file: file:/home/hadoop/ma_test.txtLoading data to table dw.sep26_ma_deposit_dimFailed with exception Wrong file format. Please check the file's format.FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
思路:
先导入存为textfile,然后再执行MR,覆写这个表
hive> create table tempshengli_test (t1 int, t2 int, t3 int, t4 string) row format delimited fields terminated by '\t' stored as textfile;OKTime taken: 0.256 secondshive> desc tempshengli_test;OKt1 intt2 intt3 intt4 stringTime taken: 0.141 secondshive> load data local inpath '/home/hadoop/ma_test.txt' into table tempshengli_test; Copying data from file:/home/hadoop/ma_test.txtCopying file: file:/home/hadoop/ma_test.txtLoading data to table dw.tempshengli_testOKTime taken: 4.228 secondshive> insert overwrite into table sep26_ma_deposit_dim as select * from tempshengli_test;FAILED: Parse Error: line 1:17 cannot recognize input near 'into' 'table' 'sep26_ma_deposit_dim' in destination specificationhive> insert overwrite table sep26_ma_deposit_dim select * from tempshengli_test; Total MapReduce jobs = 2Ended Job = job_201403301416_11274516 Rows loaded to sep26_ma_deposit_dimOKTime taken: 64.341 seconds
drop table tempshengli_test
2.文本格式不匹配
还要注意格式, Unix UTF-8和Windows上的ANSI上传上去不一样。
0 0
- Hive导入sequencefile错误
- hive使用orcfile parquet sequencefile
- hive中的TextFile转为SequenceFile
- hive sequencefile 和rcfile 效率对比
- hive sequencefile 和rcfile 效率对比
- Hive总结(二) Hive导入时,格式不对错误
- SequenceFile
- SequenceFile
- sequencefile
- sqoop 从mysql数据库导入到hive表格错误解决方法
- hive存储格式sequencefile和rcfile的对比
- hive存储格式sequencefile和rcfile的对比
- hive 存储格式和压缩方式 一:Snappy + SequenceFile
- 使用MapReduce读取SequenceFile文件,批量导入HBase
- Hive错误
- hive数据导入
- Hive 导入导出数据
- hive数据导入
- camera的分辨率
- infiniDB无法建表
- 黑马程序员(学习日记3)
- iOS:字典数组排序
- lua程序设计里面的调用Lua函数的小例子 有个错误被我找到了
- Hive导入sequencefile错误
- 进销存设计与分析_总体(1)
- MSSQLSERVER之发布-分发-订阅
- deep learning 学习材料与其他有用教程
- [Leetcode]Sudoku Solver&&Valid Sudoku
- Windows API 消息和回调函数理解
- C++ array类作为函数参数传递
- RabbitMQ(七)用RabbitMQ实现分布式系统里的信号量控制 -- Distributed Semaphores with RabbitMQ
- 获取 ios 系统网络状况、电量