Return-Path: X-Original-To: apmail-hadoop-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-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 9202CE51F for ; Sat, 26 Jan 2013 16:01:45 +0000 (UTC) Received: (qmail 60283 invoked by uid 500); 26 Jan 2013 16:01:41 -0000 Delivered-To: apmail-hadoop-user-archive@hadoop.apache.org Received: (qmail 59975 invoked by uid 500); 26 Jan 2013 16:01:40 -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 59956 invoked by uid 99); 26 Jan 2013 16:01:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Jan 2013 16:01:39 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of harsh@cloudera.com designates 209.85.210.176 as permitted sender) Received: from [209.85.210.176] (HELO mail-ia0-f176.google.com) (209.85.210.176) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Jan 2013 16:01:34 +0000 Received: by mail-ia0-f176.google.com with SMTP id i18so2175872iac.35 for ; Sat, 26 Jan 2013 08:01:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type:x-gm-message-state; bh=QbVDa/7TbP+KyhUpS9MXMPNIaXiaVgjOxkKt42RhVdo=; b=POv5IwRYij6pownfmHMpii7qpJGoRdDdFwX1sRO/T4cfvwgQ4v3pVClOMdXrXknuXC uxKXqF91tW+vaXD0mTTJpqKPRbbUOLOx53LvBarx320JonUXygJxjroFFvIZyoOPK0mA h/lS52lasB7lL2wQqwVrqYp7Tj6+kkQVqU4Oo1LmkA/raXD4HY+h4cxrwGi3fxlLQqNC 53JCj2gU0rm9PDkaYQPRMoWU8gx606Uk3fb+XOj+0hMmgJVQ9dkD+7F8nlZquRzkP4Oj HUXmw9Rdwu3/graNm+h4kXTkJq4q2gArTcMDWwETMPqnNrZIgI/z5Oj7UQLD5aDcpLqK XQ+g== X-Received: by 10.50.217.167 with SMTP id oz7mr1358062igc.26.1359216073455; Sat, 26 Jan 2013 08:01:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.9.226 with HTTP; Sat, 26 Jan 2013 08:00:53 -0800 (PST) In-Reply-To: <51038155.2010700@cse.ohio-state.edu> References: <51038155.2010700@cse.ohio-state.edu> From: Harsh J Date: Sat, 26 Jan 2013 21:30:53 +0530 Message-ID: Subject: Re: Executing a Python program inside Map Function To: "" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmCMpTvPtD508qslO+dFOf9vz/Ef/4PsC3mH1uMX9nk74f7Nc98C16y+By+oY3YlNXZHzkm X-Virus-Checked: Checked by ClamAV on apache.org Java provides the Process class to help you launch and read/write from/to processes: http://docs.oracle.com/javase/6/docs/api/java/lang/Process.html. You can use this to spawn your program from your code, to write input into the process's stdin, and to read its output via its stdout/etc.. The hadoop-streaming parts of Apache Hadoop is very similar in its operations - but allows little control back on the launched java map class which you seem to require. The tasks (both M and R types) provide entry and exit API points (configure()/setup(), and cleanup()) - allowing you to spawn a process before map-reads start, and end it after, letting you manage your spawned process more cleanly. On Sat, Jan 26, 2013 at 12:40 PM, Sundeep Kambhampati wrote: > Is it possible to run a python script inside a Map function which is in > java? > > I what to to run a python script which is on my local disk and I want to use > the output of that script for further processing in Map Function to produce > Pairs. > Can some give me some idea how to do it. > > > Regards > Sundeep -- Harsh J