我的Sqoop版本是1.4.6-cdh5.7.0。 我的Sqoop命令是:
sqoop export --table customerservicerep --connect jdbc:mysql://localhost/3febbraio \
--username training --password training --update-mode allowinsert \
--export-dir /3febbraio/sqoop_parquet/customerservicerep --verbose
我得到的错误是:
2018-02-04 02:16:04,098 WARN [main] org.apache.hadoop.mapred.YarnChild: Exception running child : parquet.io.ParquetDecodingException: Can not read value at 1 in block 0 in file hdfs://localhost:8020/3febbraio/sqoop_parquet/customerservicerep/64e8ebb2-46fa-41c4-aef2-dac336a27c82.parquet
at parquet.hadoop.InternalParquetRecordReader.nextKeyValue(InternalParquetRecordReader.java:241)
at parquet.hadoop.ParquetRecordReader.nextKeyValue(ParquetRecordReader.java:227)
at org.kitesdk.data.spi.filesystem.AbstractCombineFileRecordReader.nextKeyValue(AbstractCombineFileRecordReader.java:68)
at org.apache.hadoop.mapreduce.lib.input.CombineFileRecordReader.nextKeyValue(CombineFileRecordReader.java:69)
at org.kitesdk.data.spi.AbstractKeyRecordReaderWrapper.nextKeyValue(AbstractKeyRecordReaderWrapper.java:55)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:556)
at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:80)
at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:91)
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:787)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1693)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.ClassCastException: customerservicerep cannot be cast to org.apache.avro.generic.IndexedRecord
at parquet.avro.AvroIndexedRecordConverter.start(AvroIndexedRecordConverter.java:185)
at parquet.io.RecordReaderImplementation.read(RecordReaderImplementation.java:391)
at parquet.hadoop.InternalParquetRecordReader.nextKeyValue(InternalParquetRecordReader.java:216)
... 16 more
出于某种原因,Sqoop试图将Parquet文件视为Avro文件。我该如何解决?