我有简单的蜂巢查询
INSERT OVERWRITE DIRECTORY '/tmp/test'
SELECT
flight,
SUM(CASE WHEN ev=2 THEN 1 ELSE 0 END) AS req
from data_table
group by flight;
输出看起来不错(在编辑器中用 ^A 分隔)两个数字列。我已经创建了 mysql 表
create table hive_table(fl int,evs int);
最后我想用 sqoop 将数据从 hdfs 导出到 mysql
sqoop export --connect jdbc:mysql://mysqlhost/dwh --username user --password password --table hive_table --export-dir /tmp/test/ --input-fields-terminated-by "\000" --lines-terminated-by '\n'
但是我收到以下错误(尽管我看到字符串是数值),并且所有导出都失败了。我就是不明白为什么?我正在使用 cloudera cdh3
13/06/02 22:37:17 INFO mapred.JobClient: map 0% reduce 0%
13/06/02 22:37:22 INFO mapred.JobClient: Task Id : attempt_201304210944_0692_m_000001_0, Status : FAILED
java.lang.NumberFormatException: For input string: "100322836692"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:458)
at java.lang.Integer.valueOf(Integer.java:554)
at hive_table.__loadFromFields(hive_table.java:191)
at hive_table.parse(hive_table.java:143)
at com.cloudera.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:81)
at com.cloudera.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:40)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
at com.cloudera.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:189)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:647)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:323)
at org.apache.hadoop.mapred.Child$4.run(Child.java:270)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformatio