FAQ
Hey all!

I am trying to retrieve the filename of the input file into my Mapper class.
I read it's accessible from my Configuration:

String filename = context.getConfiguration().
get( "map.input.file" );

But I am also intrigued by the String[] context.getInputSplit.getLocations()
function. What other ways are available to retrieve the filename in my
Mapper Class/function?

I am using the latest 0.20.2 release.


--
Thanks

Ben Campbell

Search Discussions

  • Harsh J at Aug 7, 2010 at 5:54 am
    ((FileSplit) context.getInputSplit()).getPath() is the right way to do
    it with the new API (0.20+).

    On Sat, Aug 7, 2010 at 4:16 AM, Benjamin Campbell
    wrote:
    Hey all!

    I am trying to retrieve the filename of the input file into my Mapper class.
    I read it's accessible from my Configuration:

    String filename = context.getConfiguration().
    get( "map.input.file" );

    But I am also intrigued by the String[] context.getInputSplit.getLocations()
    function. What other ways are available to retrieve the filename in my
    Mapper Class/function?

    I am using the latest 0.20.2 release.


    --
    Thanks

    Ben Campbell


    --
    Harsh J
    www.harshj.com

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-user @
categorieshadoop
postedAug 6, '10 at 10:47p
activeAug 7, '10 at 5:54a
posts2
users2
websitehadoop.apache.org...
irc#hadoop

2 users in discussion

Benjamin Campbell: 1 post Harsh J: 1 post

People

Translate

site design / logo © 2022 Grokbase