Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 03C0E11358 for ; Thu, 22 May 2014 02:47:27 +0000 (UTC) Received: (qmail 65841 invoked by uid 500); 22 May 2014 02:47:22 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 65683 invoked by uid 500); 22 May 2014 02:47:22 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 65674 invoked by uid 99); 22 May 2014 02:47:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2014 02:47:22 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sshi@gopivotal.com designates 209.85.216.174 as permitted sender) Received: from [209.85.216.174] (HELO mail-qc0-f174.google.com) (209.85.216.174) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2014 02:47:19 +0000 Received: by mail-qc0-f174.google.com with SMTP id x13so4675837qcv.33 for ; Wed, 21 May 2014 19:46:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=09W7/GVUxPKNlaRsMdIII0S3QeS2FSdieoWd5t8eW+0=; b=RdVg3fl48GMreKZY8Z8MTAlsla8E6B7M45m+jRMyiMZLTUBssUaM+R6ZF3TdINYATl iVnrs/VKOz3bWcU+3GHmWhZ2Aop396L20k4JbK9+XF/RN/JS8pVLhfAX1eLEUpwSTgDv xWqgbUC3kAjehr2vkYBkSRF4tLXWcS6CVPLTOtUpcLRDgCKR4VzoH8z8H89yNdtAy3iv gk/kFuzM/szbEbhiuAZTSKPwcTZZqKfvZoc3XrLRCY8roolJL07tykpQP/Hu+vD0AzKE Qf5was69rwlVMHCFkZzJRN5iHHGpyqLENPT7pQ67bu6lHx7MQogrQ1h3Y2gV22N0ZWBs qcnw== X-Gm-Message-State: ALoCoQkrbKnki5coEmcLElQAZWnmrLvuVVIuXeI0SfVwUYpnIcSweWhuswsCrudKqoSNBQiT3HRA MIME-Version: 1.0 X-Received: by 10.140.86.178 with SMTP id p47mr72322533qgd.66.1400726815288; Wed, 21 May 2014 19:46:55 -0700 (PDT) Received: by 10.140.94.146 with HTTP; Wed, 21 May 2014 19:46:55 -0700 (PDT) In-Reply-To: References: Date: Thu, 22 May 2014 10:46:55 +0800 Message-ID: Subject: Re: Issue with conf.set and conf.get method From: Stanley Shi To: unmesha sreeveni , "user@hadoop.apache.org" Content-Type: multipart/alternative; boundary=001a11c13d5c40e58d04f9f420e9 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c13d5c40e58d04f9f420e9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Regards, *Stanley Shi,* On Thu, May 22, 2014 at 10:46 AM, Stanley Shi wrote: > seems my guess is correct; I mean in your program, you can call: > > > *hadoop jar myjar.jar input output " " * > > *instead you use:* > > *hadoop jar myjar.jar input output TAB* > > *or * > > > *hadoop jar myjar.jar input output WHITESPACE* > *and then in your program, * > now you use: conf.set("delimiter",args[2]); > instead you can use: > if (args[2] =3D=3D "TAG") conf.set("delimiter","\t"); > > > > > Regards, > *Stanley Shi,* > > > > On Wed, May 21, 2014 at 7:53 PM, unmesha sreeveni = wrote: > >> >> >> >> On Wed, May 21, 2014 at 3:37 PM, Stanley Shi wrote: >> >>> 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] =3D=3D "TAB" and in your program, you can convert this "TAB" to= the >>> real delimeter you want to use ("\t") >>> >> =E2=80=8B*Sorry I did nt get you=E2=80=8B* >> *I am running my job like this* >> * hadoop jar myjar.jar input output ","* >> *or* >> *hadoop jar myjar.jar input output " "* >> *And i am accessing these delimiters in mapper for spliting my inputs.* >> >>> >>> Regards, >>> *Stanley Shi,* >>> >>> >>> >>> On Wed, May 21, 2014 at 3:33 PM, unmesha sreeveni >> > wrote: >>> >>>> >>>> Hi, >>>> >>>> I am having an issue with conf.set and conf.get method >>>> Driver >>>> Configuration conf=3Dnew Configuration(); >>>> conf.set("delimiter",args[2]); //File delimiter as user argument >>>> >>>> Map/Reduce >>>> Configuration conf =3D context.getConfiguration(); >>>> String delim =3D 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 =3D new StringTokenizer(value.toString,deli= m) >>>> >>>> >>>> 2. String classLabel =3D >>>> 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/ >>>> >>>> >>>> >>> >> >> >> -- >> *Thanks & Regards * >> >> >> *Unmesha Sreeveni U.B* >> *Hadoop, Bigdata Developer* >> *Center for Cyber Security | Amrita Vishwa Vidyapeetham* >> http://www.unmeshasreeveni.blogspot.in/ >> >> >> > --001a11c13d5c40e58d04f9f420e9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Regards,
Stanley Shi,



On Thu, May 22, 2014 at 10:46 AM, Stanle= y Shi <sshi@gopivotal.com> wrote:
seems my guess is correct; I mean in your program, you can= call:
"

instead you use:
hadoop jar myjar.jar input output=C2=A0= TAB
or
<= /font>
and then in your program,
now you use: conf.set("delimiter",args[2]);=C2=A0
instead you= can use:
if (args[2] =3D=3D "TAG") conf.set("delimiter= ","\t");



Regards,
Stanley Sh= i,



On Wed, May 21, 2014 at 7:53 PM, unmesha= sreeveni <unmeshabiju@gmail.com> wrote:



On Wed, May 21, 2014 at 3:37 PM, Stanley Shi <sshi@gopivota= l.com> wrote:
Are you trying to pass arguments fro= m user input? reading input from stdin?

I suggest you use some special characters to express; for example= , let args[2] =3D=3D "TAB" and in your program, you can convert t= his "TAB" to the real delimeter you want to use ("\t")<= br>
=E2=80=8BSorry I did nt get you=E2=80=8B
I am= running my job like this
hadoop jar myjar.jar input output ","
or
hadoop jar myjar= .jar input output " "
And i am= accessing these delimiters in mapper =C2=A0for spliting my inputs.

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=3Dnew Configurat= ion();
conf.set("d= elimiter",args[2]); =C2=A0 =C2=A0 =C2=A0 //File delimiter as user argu= ment

Map/Reduce
Configuration conf =3D context.getConfiguration();
String delim =3D conf.get("del= imiter");

All things works fine with this.I am abl= e to get the delimiter("," ";" .....) and process accor= dingly except "TAB"

If I give=C2=A0=
1. \t as an argument it wont = work any operations=C2=A0
=C2=A0 =C2=A0eg: will not be able to do= =C2=A0
=C2=A0 =C2=A0 = =C2=A01. StringTokenizer st =3D new StringTokenizer(value.toString,delim)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 <but works for split>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 <String[] parts =3D value.toString.split(delim);>
=C2=A0 =C2=A0 =C2=A02. String class= Label =3D value.toString.substring(value.toString.lastIndexOf(delim)+1);

2. "\t" as a= rgument also wont work
= 3. \\t and "\\t" also wont work
4. " " this WORKS FINE as an argument.
=
Anybody came across wi= th this issue?
If so ca= n any one tell me a workaround.

Regards
Unmesha

--
Thanks & Regards

Unmesha Sreeveni U.B
Hadoop, Bigdata Developer
=
Center for Cyber Security | Amrita Vishwa Vidyap= eetham


<= /div>

<= /span>



--
Thanks & Regards

Unmesha Sreeveni U.B
Hadoop, Bigdata Developer
=
Center for Cyber Security | Amrita Vishwa Vidyap= eetham


<= /div>


--001a11c13d5c40e58d04f9f420e9--