Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # user >> Passing arguments in hadoop


Copy link to this message
-
Re: Passing arguments in hadoop
Never mind guys.
 I had a typo when I was trying to set configuration param.
Sorry.
On Tue, Aug 6, 2013 at 4:46 PM, jamal sasha <[EMAIL PROTECTED]> wrote:

> Hi,
>   I am trying to pass a parameter to multiple mappers
>
> So, I do this in my driver
>
> conf.set("delimiter", args[3]);
>
> In mapper1, I am retreiving this as:
>
> Configuration conf = context.getConfiguration();
> String[] values = value.toString().split(conf.get("delimiter"));
>
> and same is my mapper2
>
>
> But I get this error:
> 13/08/06 16:38:09 INFO mapred.JobClient: Task Id :
> attempt_201306191416_1384_m_000001_0, Status : FAILED
> java.lang.NullPointerException
> at java.util.regex.Pattern.<init>(Pattern.java:1149)
>  at java.util.regex.Pattern.compile(Pattern.java:840)
> at java.lang.String.split(String.java:2304)
> at java.lang.String.split(String.java:2346)
>  at  DataSourceOneMapper.map(DataSourceOneMapper.java:22)
> at .DataSourceOneMapper.map(DataSourceOneMapper.java:1)
>
>
> And the line 22 corresponds to this conf.get("...") line
>
> What am i doing wrong?
> Also, just to add, in this particular case delimiter is "@"
>
> So, if i do
>
> String[] values = value.toString().split("@");
>
> everything works fine??
> How do i resolve this?
> Thanks
>
>
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB