Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3BC0F200B7E for ; Tue, 6 Sep 2016 22:43:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3A9F4160ACB; Tue, 6 Sep 2016 20:43:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 81AE6160AA9 for ; Tue, 6 Sep 2016 22:43:50 +0200 (CEST) Received: (qmail 1329 invoked by uid 500); 6 Sep 2016 20:43:49 -0000 Mailing-List: contact commits-help@pig.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pig.apache.org Delivered-To: mailing list commits@pig.apache.org Received: (qmail 1319 invoked by uid 99); 6 Sep 2016 20:43:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2016 20:43:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 430B2C09EE for ; Tue, 6 Sep 2016 20:43:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.676 X-Spam-Level: X-Spam-Status: No, score=0.676 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.124] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id rRuwYqHMYUwz for ; Tue, 6 Sep 2016 20:43:48 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 5A41C5F201 for ; Tue, 6 Sep 2016 20:43:48 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B9E6BE0099 for ; Tue, 6 Sep 2016 20:43:47 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id B7C8D3A05B4 for ; Tue, 6 Sep 2016 20:43:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1759504 - in /pig/trunk: CHANGES.txt src/docs/src/documentation/content/xdocs/func.xml src/docs/src/documentation/content/xdocs/pig-index.xml Date: Tue, 06 Sep 2016 20:43:47 -0000 To: commits@pig.apache.org From: knoguchi@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160906204347.B7C8D3A05B4@svn01-us-west.apache.org> archived-at: Tue, 06 Sep 2016 20:43:51 -0000 Author: knoguchi Date: Tue Sep 6 20:43:47 2016 New Revision: 1759504 URL: http://svn.apache.org/viewvc?rev=1759504&view=rev Log: PIG-5023: Documentation for BagToTuple (icook via knoguchi) Modified: pig/trunk/CHANGES.txt pig/trunk/src/docs/src/documentation/content/xdocs/func.xml pig/trunk/src/docs/src/documentation/content/xdocs/pig-index.xml Modified: pig/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1759504&r1=1759503&r2=1759504&view=diff ============================================================================== --- pig/trunk/CHANGES.txt (original) +++ pig/trunk/CHANGES.txt Tue Sep 6 20:43:47 2016 @@ -24,6 +24,8 @@ INCOMPATIBLE CHANGES   IMPROVEMENTS +PIG-5023: Documentation for BagToTuple (icook via knoguchi) + PIG-5022: Error in TOKENIZE Example (icook vi knoguchi) PIG-4931: Document IN operator (dbist13 vi daijy) Modified: pig/trunk/src/docs/src/documentation/content/xdocs/func.xml URL: http://svn.apache.org/viewvc/pig/trunk/src/docs/src/documentation/content/xdocs/func.xml?rev=1759504&r1=1759503&r2=1759504&view=diff ============================================================================== --- pig/trunk/src/docs/src/documentation/content/xdocs/func.xml (original) +++ pig/trunk/src/docs/src/documentation/content/xdocs/func.xml Tue Sep 6 20:43:47 2016 @@ -294,6 +294,75 @@ team_parkyearslist = FOREACH (GROUP team +
+ BagToTuple +

Un-nests the elements of a bag into a tuple.

+ +
+ Syntax + + + + +
+

BagToTuple(expression)

+
+ +
+ Terms + + + + + +
+

expression

+
+

An expression with data type bag.

+
+
+ +
+ Usage +

BagToTuple creates a tuple from the elements of a bag. It removes only + the first level of nesting; it does not recursively un-nest nested bags. + Unlike FLATTEN, BagToTuple will not generate multiple output records per + input record. +

+
+
+ Examples +

In this example, a bag containing tuples with one field is converted to a tuple.

+ +A = LOAD 'bag_data' AS (B1:bag{T1:tuple(f1:chararray)}); + +DUMP A; +({('a'),('b'),('c')}) +({('d'),('e'),('f')}) + +X = FOREACH A GENERATE BagToTuple(B1); + +DUMP X; +(('a','b','c')) +(('d','e','f')) + +

In this example, a bag containing tuples with two fields is converted to a tuple.

+ +A = LOAD 'bag_data' AS (B1:bag{T1:tuple(f1:int,f2:int)}); + +DUMP A; +({(4,1),(7,8),(4,9)}) +({(5,8),(4,3),(3,8)}) + +X = FOREACH A GENERATE BagToTuple(B1); + +DUMP X; +((4,1,7,8,4,9)) +((5,8,4,3,3,8)) + +
+
+
Bloom

Bloom filters are a common way to select a limited set of records before Modified: pig/trunk/src/docs/src/documentation/content/xdocs/pig-index.xml URL: http://svn.apache.org/viewvc/pig/trunk/src/docs/src/documentation/content/xdocs/pig-index.xml?rev=1759504&r1=1759503&r2=1759504&view=diff ============================================================================== --- pig/trunk/src/docs/src/documentation/content/xdocs/pig-index.xml (original) +++ pig/trunk/src/docs/src/documentation/content/xdocs/pig-index.xml Tue Sep 6 20:43:47 2016 @@ -137,12 +137,15 @@

    and TOBAG function

    and type construction operators

    converting to string +

    converting to tuple

    schemas for multiple types

    syntax

BagToString function

+

BagToTuple function

+

batch mode. See also memory management

bincond operator ( ?: )