sqoop匯出hive資料到mysql錯誤ava.util.NoSuchElementException解決辦法
sqoop錯誤日誌:
14/05/08 12:25:40 INFO mapred.JobClient: Task Id : attempt_201405071437_0013_m_000000_0, Status : FAILED
java.io.IOException: Can't export data, please check task tracker logs
at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:112)
at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:39)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1149)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: java.util.NoSuchElementException
at java.util.ArrayList$Itr.next(ArrayList.java:794)
at wordcount.__loadFromFields(wordcount.java:198)
at wordcount.parse(wordcount.java:147)
at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:83)
... 10 more
14/05/08 12:25:40 INFO mapred.JobClient: Task Id : attempt_201405071437_0013_m_000001_0, Status : FAILED
java.io.IOException: Can't export data, please check task tracker logs
at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:112)
at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:39)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1149)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: java.util.NoSuchElementException
at java.util.ArrayList$Itr.next(ArrayList.java:794)
at wordcount.__loadFromFields(wordcount.java:198)
at wordcount.parse(wordcount.java:147)
at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:83)
... 10 more
sqoop匯出語句:
sqoop export --connect jdbc:mysql://icity0:3306/sqoop --username root --password root --table wordcount --input-fields-terminated-by '\001' --export-dir '/user/hive/warehouse/wordcount'
這個錯誤的原因是指定Hive中表欄位之間使用的分隔符錯誤,供Sqoop讀取解析不正確,由於此處hive中的資料是由hdfs中匯入的,其分隔符是'\t',故修改從下列的匯出語句即可:
sqoop export --connect jdbc:mysql://icity0:3306/sqoop --username root --password root --table wordcount --input-fields-terminated-by '\t' --export-dir '/user/hive/warehouse/wordcount'
注:如果是由hive執行mapreduce操作彙總的結果,預設的分隔符是 '\001'.
相關文章
- Sqoop匯出ClickHouse資料到HiveOOPHive
- sqoop用法之mysql與hive資料匯入匯出OOPMySqlHive
- Mysql出現連線錯誤解決辦法MySql
- Sqoop將MySQL資料匯入到hive中OOPMySqlHive
- SQLServer匯出匯入資料到MySQLServerMySql
- 帝國CMS匯入恢復資料MySQL server has gone away錯誤的解決辦法MySqlServerGo
- sqoop1.4.7環境搭建及mysql資料匯入匯出到hiveOOPMySqlHive
- git add .出現錯誤LF will be replaced by CRLF in 解決辦法Git
- 畢設之錯誤解決辦法
- Idea編譯錯誤解決辦法Idea編譯
- MYSQL資料庫匯入資料時出現亂碼的解決辦法MySql資料庫
- sqoop資料匯入匯出OOP
- PbootCMS資料庫配置,修改為Mysql資料庫,配置Mysql出錯解決辦法boot資料庫MySql
- photoshop匯出png發生未知錯誤的解決方案,ps匯出發生未知錯誤怎麼解決
- 出現可怕的NoSuchMethodError錯誤的解決辦法 -Gunnar MorlingError
- Ubuntu20.04安裝MySQL8.0時出現依賴錯誤解決辦法UbuntuMySql
- ubuntu下import matplotlib錯誤解決辦法UbuntuImport
- Ubuntu 安裝包時提示錯誤E: Unable to locate package mysql-server錯誤 解決辦法UbuntuPackageMySqlServer
- 【問題排查】sqoop將mysql匯入hive異常:No suitable driverOOPMySqlHiveUI
- mysqldump error1066 錯誤的解決辦法MySqlError
- Git 錯誤:fatel: loose object ... is corrupt 解決辦法GitObject
- iOS路上遇到的錯誤及解決辦法iOS
- ORA-39006錯誤原因及解決辦法
- spark sql與mysql 資料載入與匯出資料到mysqlSparkMySql
- 利用跳板機連線mysql,匯出資料到csvMySql
- docker 容器環境下的 MySQL 拒絕連線錯誤解決辦法DockerMySql
- 安裝wsl錯誤的一種解決辦法
- 【git】Git commit時提示錯誤時 解決辦法GitMIT
- 解決Mysql資料庫插入資料出現問號(?)的解決辦法MySql資料庫
- PhpSpreadsheet匯出Excel超過26列解決辦法PHPExcel
- Laravel 執行 Gulp 命令出錯解決辦法Laravel
- CATIA許可證時間錯誤的解決辦法
- kali更新源數字簽名錯誤解決辦法
- Windows git remote: HTTP Basic: Access denied 錯誤解決辦法WindowsGitREMHTTP
- JPA-style positional param was not an integral ordinal錯誤解決辦法
- Excel匯入null錯誤解決方式ExcelNull
- 伺服器出現500錯誤的原因和解決辦法伺服器
- Python批量匯入Excel資料到MySQLPythonExcelMySql
- 錯誤720寬頻連線解決辦法 寬頻連線錯誤程式碼720怎麼解決