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 B333D18138 for ; Tue, 6 Oct 2015 13:27:13 +0000 (UTC) Received: (qmail 41916 invoked by uid 500); 6 Oct 2015 13:26:57 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 41787 invoked by uid 500); 6 Oct 2015 13:26:57 -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 41777 invoked by uid 99); 6 Oct 2015 13:26:56 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Oct 2015 13:26:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8DCF1180A49 for ; Tue, 6 Oct 2015 13:26:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.899 X-Spam-Level: ** X-Spam-Status: No, score=2.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id JJxHI23byOeW for ; Tue, 6 Oct 2015 13:26:50 +0000 (UTC) Received: from mail-vk0-f44.google.com (mail-vk0-f44.google.com [209.85.213.44]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 4AEE220F20 for ; Tue, 6 Oct 2015 13:26:50 +0000 (UTC) Received: by vkgd64 with SMTP id d64so117280265vkg.0 for ; Tue, 06 Oct 2015 06:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=xPF+AsZfU0ZcGCsc65LlMJYQj2QPuRv2Y0YFyVHGVxc=; b=dXOF2H95TS8QKq0ODwdlymTq9vUfY3CxcumwBb9ODiu40WEO8SZXA4SONeJxDjPu+1 lyot/e8lxYz8iqJZVa4rKsbdDR34qch6yNPIhzWL4vhaPaUEaKLB5ae4by5gVr91uQ9u QmGjEc/BaHl2RNVcXiEJd9RQXWJOXy+JdbRWrL7l0/wW8YYmBW0egiGhbW/ipkVA4p8j R4XFG09Ce0Su+GTt6Z6oKmt5NQfDOPQUMRr7Ec6MZSxJ21e2F9HNp5ibUVXW/brpevjo CE5arwE5Ve45DqXHWY8YURiJtL6B4Jb5fK5vVn5abpGHHqzkkc5ikRwGvGuVnX1dA55d 9MAw== MIME-Version: 1.0 X-Received: by 10.31.141.130 with SMTP id p124mr21973578vkd.44.1444138002989; Tue, 06 Oct 2015 06:26:42 -0700 (PDT) Received: by 10.103.91.67 with HTTP; Tue, 6 Oct 2015 06:26:42 -0700 (PDT) In-Reply-To: References: Date: Tue, 6 Oct 2015 09:26:42 -0400 Message-ID: Subject: Re: Passing Args to Mappers and Reducers From: Shahab Yunus To: "user@hadoop.apache.org" Content-Type: multipart/alternative; boundary=001a11425a4eae552f05216f9414 --001a11425a4eae552f05216f9414 Content-Type: text/plain; charset=UTF-8 Are you properly implementing the Tool interface? https://hadoopi.wordpress.com/2013/06/05/hadoop-implementing-the-tool-interface-for-mapreduce-driver/ Also, there needs to be space between -D and the param name. Regards, Shahab On Tue, Oct 6, 2015 at 9:22 AM, Istabrak Abdul-Fatah wrote: > Greetings to all, > Is it possible to pass args to Mapper and Reducers via the command line > args. > I need to pass some args upon the MapRed job invocation so that I can pass > these args via the Context object to the Mapper and Reducer code. > I am currently running Hadoop2.7 and tried to pass some args using the -D > VM args but it did not succeed. > Here are some failed code snippets: > > ~]$ yarn -Dista="666666" jar /opt/yarn/my_examples/AvgSix.jar > /user/yarn/input/samplefile.csv output > > ~]$ yarn jar -Dista="666666" /opt/yarn/my_examples/AvgSix.jar > /user/yarn/input/samplefile.csv output > > ~]$ yarn jar /opt/yarn/my_examples/AvgSix.jar > /user/yarn/input/samplefile.csv output -Dista="666666" > > Please advise. > > > Thx and BR > > Ista > --001a11425a4eae552f05216f9414 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Are you properly implementing the Tool interface?=

Also, there needs to be space between -D and the param = name.

Regards,
Shahab

On Tue, Oct 6, 2015 at 9= :22 AM, Istabrak Abdul-Fatah <ifatah@gmail.com> wrote:
Greetings to all,
Is it po= ssible to pass args to Mapper and Reducers via the command line args.
=
I need to pass some args upon the MapRed job invocation so that I can = pass these args via the Context object to the Mapper and Reducer code.
I am currently running Hadoop2.7 and tried to pass some args using th= e -D VM args but it did not succeed.
Here are some failed code sn= ippets:

~]$ yarn -Dista=3D"666666" jar /= opt/yarn/my_examples/AvgSix.jar /user/yarn/input/samplefile.csv output
<= /div>

~]$ yarn =C2=A0jar -Dista=3D"666666" /op= t/yarn/my_examples/AvgSix.jar /user/yarn/input/samplefile.csv output
<= div>
~]$ yarn =C2=A0jar /opt/yarn/my_examples/AvgSix.jar /use= r/yarn/input/samplefile.csv output =C2=A0-Dista=3D"666666"=C2=A0<= br>

Please advise.


Thx and BR

Ista

--001a11425a4eae552f05216f9414--