简体   繁体   中英

Hadoop Map Reduce CustomRecordReader

I followed this guide to create a custom inputsplit for hadoop. Now I have an exception each time on this:

FileSplit split = (FileSplit) genericSplit;

I imported this 2:

import org.apache.hadoop.mapred.FileSplit;
import org.apache.hadoop.mapreduce.InputSplit;

but I do not understand why give me exception. FileSplit extends the InputSplit , so why exceptions?

I think you want

import org.apache.hadoop.mapreduce.lib.input.FileSplit;

and not

import org.apache.hadoop.mapred.FileSplit;

Or, at the least, you seem to be mixing the use of these two different classes ( oahmapreduce.lib.input.FileSplit vs oahmapred.FileSplit ). Read your exception message carefully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM