码迷,mamicode.com
首页 > 其他好文 > 详细

记录几个sqoop任务执行中遇到的错误

时间:2018-11-27 17:12:11      阅读:614      评论:0      收藏:0      [点我收藏+]

标签:字符   sqoop   parameter   creat   har   only   property   size   prope   

sqoop报错
1. sqoop将mysql中的数据导入到hive中
报错:Hive does not support the SQL type for column ssl_cipher     
原因:报这个错是因为hive不支持mysql表中某些字段的类型
解决:--map-column-hive ssl_cipher=string,x509_issuer=string,x509_subject=string \  这个是强制转换mysql表中某个字段的类型为string类型,多个字段中间以逗号隔开,,,,加这个指令加入到sqoop脚本中
sqoop脚本指令如下:
sqoop import \
--connect jdbc:mysql://技术分享图片*****:***/mysql \
--username **** \
--password **** \
--table user \
--fields-terminated-by "\t" \
--lines-terminated-by "\n" \
-m 1 \
--hive-import \
--hive-database default \
--create-hive-table \
--hive-table usertest \
--hive-overwrite \
--map-column-hive ssl_cipher=string,x509_issuer=string,x509_subject=string \  这个是强制转换mysql表中某个字段的类型为string类型,多个字段中间以逗号隔开
--delete-target-dir
 
2.sqoop从mysql中导入数据到hive中
报错:ERROR tool.ImportTool: Import failed: 技术分享图片java.io.IOException: Generating splits for a textual index column allowed only in case of "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" property passed as a parameter
原因:主要问题是“--split-by id”这个参数指定的id是一个文本格式,所以需要在命令中加入选项"-Dorg.apache.sqoop.splitter.allow_text_splitter=true",(这个参数具体是什么意思我也不懂)
解决办法:-Dorg.apache.sqoop.splitter.allow_text_splitter=true把这个指令假如到sqoop指令脚本中
 
3.sqoop从mysql中导入数据到hive中
报错: ERROR tool.ImportTool: Imported Failed: Character 8216 is an out-of-range delimiter
解决办法:仔细检查指令中的字符,看看有没有中文状态的,我的就是中文状态的单引号引起的报错
 
4.报错:技术分享图片
原因:这种错一般是地址或数据库写错,连接不上
解决办法:仔细检查。

 

 

记录几个sqoop任务执行中遇到的错误

标签:字符   sqoop   parameter   creat   har   only   property   size   prope   

原文地址:https://www.cnblogs.com/wtb0810/p/10026505.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!