Return-Path: Delivered-To: apmail-pig-user-archive@www.apache.org Received: (qmail 41304 invoked from network); 6 Dec 2010 21:14:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Dec 2010 21:14:48 -0000 Received: (qmail 90552 invoked by uid 500); 6 Dec 2010 21:14:47 -0000 Delivered-To: apmail-pig-user-archive@pig.apache.org Received: (qmail 90516 invoked by uid 500); 6 Dec 2010 21:14:47 -0000 Mailing-List: contact user-help@pig.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pig.apache.org Delivered-To: mailing list user@pig.apache.org Received: (qmail 90508 invoked by uid 99); 6 Dec 2010 21:14:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Dec 2010 21:14:47 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [69.147.107.20] (HELO mrout1-b.corp.re1.yahoo.com) (69.147.107.20) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Dec 2010 21:14:42 +0000 Received: from pugholehand-lm.corp.yahoo.com (pugholehand-lm.corp.yahoo.com [10.72.115.44]) by mrout1-b.corp.re1.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id oB6LDJCZ033175 for ; Mon, 6 Dec 2010 13:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=yahoo-inc.com; s=cobra; t=1291670000; bh=RhfeFPOzxhKFUBrq0YnQmxN/yHMTyFCU2avBBscXeMk=; h=Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References; b=cfZ2kL4B9rMMYAUUhCQcRPgo4svI+hzZa2cmi8NfxY2JQsvJxygnIHyw2Qcd4NehZ 8vg4U/s0002f58LuDbZ9Zv9BoM3G5P5KuhmINLntECQs0MXNc2CO3q/PWcNmOEH9T+ sp0ok6tustjtkp9q+w19mPNUAxptxxN79Eg4eWY0= Message-Id: From: Alan Gates To: "user@pig.apache.org" In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Easy question...difference between this::form and this.form? Date: Mon, 6 Dec 2010 13:13:19 -0800 References: <4CFD31B4.1060508@yahoo-inc.com> <201012062109.09471.anzenews@volja.net> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org The reason it's needed is that ambiguities would result otherwise. A = load 'foo' as (x, y, z); B = load 'bar' as (w, x, y, z); C = join A by x, B by x; D = filter C by z > 0; -- which z? As long as the name is not ambiguous, the :: is not required. So in the above example it would be perfectly legal to say D = filter C by w > 0; Out of curiosity, why do you want to remove the :: names? Alan. On Dec 6, 2010, at 1:05 PM, Jonathan Coveney wrote: > Hijack away. I would be curious as to the reason we need this as well. > > 2010/12/6 Anze > >> >> Sorry to hijack your question, Jonathan, but while we are at it... :) >> >> Is there a way to tell Pig NOT to add "base_alias::"? Almost half >> my code >> consists of FOREACH... GENERATE that just remove these prefixes. >> >> Thanks, >> >> Anze >> >> On Monday 06 December 2010, Daniel Dai wrote: >>> After join, cross, foreach flatten, Pig will automatically add >>> "base_alias::" prefix. All other cases use "." >>> >>> Daniel >>> >>> Jonathan Coveney wrote: >>>> It's very hard to search for this among the docs because it's so >> generic, >>>> so I thought I'd ask... I'm sure the answer is painfully easy. >>>> >>>> Taking a look at this code that I found online, for example >>>> >>>> -- >>>> -- Read in a bag of tuples (timeseries for this example) and >>>> divide the >>>> -- numeric column by its maximum. >>>> -- >>>> %default DATABAG 'data/timeseries.tsv' >>>> >>>> data = LOAD '$DATABAG' AS (month:chararray, count:int); >>>> accumulate = GROUP data ALL; >>>> calc_max = FOREACH accumulate GENERATE FLATTEN(data), >>>> MAX(data.count) AS max_count; >>>> normalize = FOREACH calc_max GENERATE data::month AS month, >>>> data::count AS count, (float)data::count / (float)max_count AS >>>> normed_count; >>>> DUMP normalize; >>>> >>>> What purpose does data::month serve versus data.count? >>>> >>>> Thanks >> >>