hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsh J <qwertyman...@gmail.com>
Subject Re: How to get file name
Date Mon, 04 Oct 2010 07:47:49 GMT
There is a newer FileSplit class in mapreduce.lib.input, you should cast it
to that I believe, not the mapred, deprecated one since you are using the
unstable API as per your code snippet.

On Oct 4, 2010 1:10 PM, <y_823910@tsmc.com> wrote:

I am using hadoop0.20.1
Try to get the filename, but it didn't work by following codes.
Any suggestion?

FileSplit fileSplit = (FileSplit) context.getInputSplit();
String fileName = fileSplit.getPath().getName();

Error message
cannot be cast to org.apache.hadoop.mapred.FileSplit

Fleming Chiu(邱宏明)
TEL: 707-2260
Be Veg! Go Green! Save the planet!

                                                        TSMC PROPERTY
 This email communication (and any attachments) is proprietary information
 for the sole use of its
 intended recipient. Any unauthorized review, use or distribution by anyone
 other than the intended
 recipient is strictly prohibited.  If you are not the intended recipient,
 please notify the sender by
 replying to this email, and then delete this email and any copies of it
 immediately. Thank you.

View raw message