hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Shi <s...@gopivotal.com>
Subject Re: Issue with conf.set and conf.get method
Date Wed, 21 May 2014 10:07:43 GMT
Are you trying to pass arguments from user input? reading input from stdin?

I suggest you use some special characters to express; for example, let
args[2] == "TAB" and in your program, you can convert this "TAB" to the
real delimeter you want to use ("\t")

Regards,
*Stanley Shi,*



On Wed, May 21, 2014 at 3:33 PM, unmesha sreeveni <unmeshabiju@gmail.com>wrote:

>
> Hi,
>
> I am having an issue with conf.set and conf.get method
> Driver
> Configuration conf=new Configuration();
> conf.set("delimiter",args[2]);       //File delimiter as user argument
>
> Map/Reduce
> Configuration conf = context.getConfiguration();
> String delim = conf.get("delimiter");
>
> All things works fine with this.I am able to get the delimiter("," ";"
> .....) and process accordingly except "TAB"
>
> If I give
> 1. \t as an argument it wont work any operations
>    eg: will not be able to do
>      1. StringTokenizer st = new StringTokenizer(value.toString,delim)
>                   <but works for split>
>                   <String[] parts = value.toString.split(delim);>
>      2. String classLabel =
> value.toString.substring(value.toString.lastIndexOf(delim)+1);
>
> 2. "\t" as argument also wont work
> 3. \\t and "\\t" also wont work
> 4. " " this WORKS FINE as an argument.
>
> Anybody came across with this issue?
> If so can any one tell me a workaround.
>
> Regards
> Unmesha
>
> --
> *Thanks & Regards *
>
>
> *Unmesha Sreeveni U.B*
> *Hadoop, Bigdata Developer*
> *Center for Cyber Security | Amrita Vishwa Vidyapeetham*
> http://www.unmeshasreeveni.blogspot.in/
>
>
>

Mime
View raw message