Return-Path: Delivered-To: apmail-hadoop-pig-dev-archive@www.apache.org Received: (qmail 95072 invoked from network); 22 Jun 2010 17:55:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Jun 2010 17:55:19 -0000 Received: (qmail 92671 invoked by uid 500); 22 Jun 2010 17:55:18 -0000 Delivered-To: apmail-hadoop-pig-dev-archive@hadoop.apache.org Received: (qmail 92602 invoked by uid 500); 22 Jun 2010 17:55:17 -0000 Mailing-List: contact pig-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pig-dev@hadoop.apache.org Delivered-To: mailing list pig-dev@hadoop.apache.org Received: (qmail 92594 invoked by uid 99); 22 Jun 2010 17:55:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 17:55:17 +0000 X-ASF-Spam-Status: No, hits=-1537.0 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 17:55:17 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o5MHsuLS019429 for ; Tue, 22 Jun 2010 17:54:56 GMT Message-ID: <13260890.17131277229296697.JavaMail.jira@thor> Date: Tue, 22 Jun 2010 13:54:56 -0400 (EDT) From: "Aniket Mokashi (JIRA)" To: pig-dev@hadoop.apache.org Subject: [jira] Commented: (PIG-506) Does pig need a NATIVE keyword? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PIG-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12881263#action_12881263 ] Aniket Mokashi commented on PIG-506: ------------------------------------ Revised syntax -- as from the proposal document (+ few changes) {code} B = native ('mymr.jar' [, 'other.jar' ...]) A store into 'storeLocation' using storeFunc load 'loadLocation' using loadFunc; {code} mymr.jar contains the MR code the user wants to run. storeLocation is location the user's code expects to find the data. storeFunc is the storage function Pig will use to store the data (from A) loadLocation is where user's code will write the result data loadFunc is the load function Pig will use to reload the data (into B) other,jar contains jars to be shipped like InputFormat, OutputFormat for custom handling of mapreduce jobs. > Does pig need a NATIVE keyword? > ------------------------------- > > Key: PIG-506 > URL: https://issues.apache.org/jira/browse/PIG-506 > Project: Pig > Issue Type: New Feature > Components: impl > Reporter: Alan Gates > Assignee: Alan Gates > Priority: Minor > > Assume a user had a job that broke easily into three pieces. Further assume that pieces one and three were easily expressible in pig, but that piece two needed to be written in map reduce for whatever reason (performance, something that pig could not easily express, legacy job that was too important to change, etc.). Today the user would either have to use map reduce for the entire job or manually handle the stitching together of pig and map reduce jobs. What if instead pig provided a NATIVE keyword that would allow the script to pass off the data stream to the underlying system (in this case map reduce). The semantics of NATIVE would vary by underlying system. In the map reduce case, we would assume that this indicated a collection of one or more fully contained map reduce jobs, so that pig would store the data, invoke the map reduce jobs, and then read the resulting data to continue. It might look something like this: > {code} > A = load 'myfile'; > X = load 'myotherfile'; > B = group A by $0; > C = foreach B generate group, myudf(B); > D = native (jar=mymr.jar, infile=frompig outfile=topig); > E = join D by $0, X by $0; > ... > {code} > This differs from streaming in that it allows the user to insert an arbitrary amount of native processing, whereas streaming allows the insertion of one binary. It also differs in that, for streaming, data is piped directly into and out of the binary as part of the pig pipeline. Here the pipeline would be broken, data written to disk, and the native block invoked, then data read back from disk. > Another alternative is to say this is unnecessary because the user can do the coordination from java, using the PIgServer interface to run pig and calling the map reduce job explicitly. The advantages of the native keyword are that the user need not be worried about coordination between the jobs, pig will take care of it. Also the user can make use of existing java applications without being a java programmer. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.