2014-10-31 11:21:11,428 WARN mapred.LocalJobRunner - job_local2101226201_0002java.io.IOException: java.sql.BatchUpdateException: Unknown column 'batchId' in 'field list' at org.apache.gora.sql.store.SqlStore.flush(SqlStore.java:340) at org.apache.gora.sql.store.SqlStore.close(SqlStore.java:185) at org.apache.gora.mapreduce.GoraRecordWriter.close(GoraRecordWriter.java:55) at org.apache.hadoop.mapred.ReduceTask$NewTrackingRecordWriter.close(ReduceTask.java:578) at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:651) at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:418) at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:398)Caused by: java.sql.BatchUpdateException: Unknown column 'batchId' in 'field list' at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2028) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1451) at org.apache.gora.sql.store.SqlStore.flush(SqlStore.java:328) ... 6 moreCaused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'batchId' in 'field list' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2427) at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1980) ... 8 more
这个错误就是在我的Mysql建立的表中少了'batchId'这个字段!!!
nutch是从别人博客上学习的。所有他的数据库中的表是缺少这个字段。
`batchId`varchar(767)DEFAULTNULL, # 注意这里。有的博客中这个字段是没有的,所以出现了错误
CREATE TABLE `webpage` (`id` varchar(100) NOT NULL,# 这里很多人都是 767 ,我的mysql 报错,我就该为100`headers` blob,`text` mediumtext DEFAULT NULL,`status` int(11) DEFAULT NULL,`markers` blob,`parseStatus` blob,`modifiedTime` bigint(20) DEFAULT NULL,`score` float DEFAULT NULL,`typ` varchar(32) CHARACTER SET latin1 DEFAULT NULL,`baseUrl` varchar(767) DEFAULT NULL,`content` longblob,`title` varchar(2048) DEFAULT NULL,`reprUrl` varchar(767) DEFAULT NULL,`fetchInterval` int(11) DEFAULT NULL,`prevFetchTime` bigint(20) DEFAULT NULL,`inlinks` mediumblob,`prevSignature` blob,`outlinks` mediumblob,`fetchTime` bigint(20) DEFAULT NULL,`retriesSinceFetch` int(11) DEFAULT NULL,`protocolStatus` blob,`signature` blob,`metadata` blob,`batchId`varchar(767)DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDBROW_FORMAT=COMPRESSEDDEFAULT CHARSET=utf8mb4;