You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@hadoop.apache.org by zhangguoping zhangguoping <zh...@gmail.com> on 2010/06/27 16:59:46 UTC

how to get the current input file in a Mapper

Hi,

how to get the current input file in a Mapper in 0.20.2 ?

Thanks,

Re: how to get the current input file in a Mapper

Posted by zhangguoping zhangguoping <zh...@gmail.com>.
It works. Thanks.

2010/6/28 Ted Yu <yu...@gmail.com>

> How about:
> FileSplit fileSplit = (FileSplit) context.getInputSplit();
> String sFileName = fileSplit.getPath().getName();
>
>
> On Sun, Jun 27, 2010 at 7:59 AM, zhangguoping zhangguoping <
> zhangguoping96@gmail.com> wrote:
>
> > Hi,
> >
> > how to get the current input file in a Mapper in 0.20.2 ?
> >
> > Thanks,
> >
>

Re: how to get the current input file in a Mapper

Posted by Ted Yu <yu...@gmail.com>.
How about:
FileSplit fileSplit = (FileSplit) context.getInputSplit();
String sFileName = fileSplit.getPath().getName();


On Sun, Jun 27, 2010 at 7:59 AM, zhangguoping zhangguoping <
zhangguoping96@gmail.com> wrote:

> Hi,
>
> how to get the current input file in a Mapper in 0.20.2 ?
>
> Thanks,
>