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 3568E200ACC for ; Mon, 2 May 2016 17:39:20 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 347251609A6; Mon, 2 May 2016 17:39:20 +0200 (CEST) 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 7B03E1609B1 for ; Mon, 2 May 2016 17:39:19 +0200 (CEST) Received: (qmail 14250 invoked by uid 500); 2 May 2016 15:39:13 -0000 Mailing-List: contact dev-help@crunch.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@crunch.apache.org Delivered-To: mailing list dev@crunch.apache.org Received: (qmail 14198 invoked by uid 500); 2 May 2016 15:39:13 -0000 Delivered-To: apmail-incubator-crunch-dev@incubator.apache.org Received: (qmail 14064 invoked by uid 99); 2 May 2016 15:39:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 May 2016 15:39:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 070EE2C1F6C for ; Mon, 2 May 2016 15:39:13 +0000 (UTC) Date: Mon, 2 May 2016 15:39:13 +0000 (UTC) From: "Josh Wills (JIRA)" To: crunch-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CRUNCH-607) MemGroupedTable - iterator() can only be called once on this Iterable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 02 May 2016 15:39:20 -0000 [ https://issues.apache.org/jira/browse/CRUNCH-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15266824#comment-15266824 ] Josh Wills commented on CRUNCH-607: ----------------------------------- +1 > MemGroupedTable - iterator() can only be called once on this Iterable > --------------------------------------------------------------------- > > Key: CRUNCH-607 > URL: https://issues.apache.org/jira/browse/CRUNCH-607 > Project: Crunch > Issue Type: Bug > Components: Core > Affects Versions: 0.8.4 > Reporter: Nathan Schile > Assignee: Josh Wills > Attachments: CRUNCH-607.patch > > > From the user mailing list: > I'm running into a "java.lang.IllegalStateException: iterator() can only be called once on this Iterable" [1] when running a unit test that > utilizes a MemCollection. The pipeline appears to runs fine when running on a cluster. I have a PGroupedTable that I am running multiple operations (mapValues, ungroup) [2] on that is causing the exception. The mapValues and the ungroup operations are run in separate jobs on the cluster, so I don't believe I should be running into iterator issues. This constraint was introduced by CRUNCH-192 [3]. > Gabriel Reid stated "Looks like the MemPipeline is doing something wrong when multiple PCollections are created from a single PCollection." [4] > [1] > apache-crunch-0.8.4 branch > iterator() can only be called once on this Iterable > java.lang.IllegalStateException: iterator() can only be called once on this Iterable > at org.apache.crunch.impl.SingleUseIterable.iterator(SingleUseIterable.java:43) > at org.apache.crunch.impl.mem.collect.MemGroupedTable$UngroupFn.process(MemGroupedTable.java:148) > at org.apache.crunch.impl.mem.collect.MemGroupedTable$UngroupFn.process(MemGroupedTable.java:145) > at org.apache.crunch.impl.mem.collect.MemCollection.parallelDo(MemCollection.java:155) > at org.apache.crunch.impl.mem.collect.MemCollection.parallelDo(MemCollection.java:143) > at org.apache.crunch.impl.mem.collect.MemGroupedTable.ungroup(MemGroupedTable.java:142) > [2] > PGroupedTable itemsByPersonId = > AvroCollections.keyByAvroField(items, "person_id", Avros.strings()).groupByKey(); > PTable newestOrderByPersonId = > itemsByPersonId > .mapValues("Find latest order for each person", new MaxOrderMapFn(), Avros.longs()); > return itemsByPersonId.ungroup().join(newestOrderByPersonId).parallelDo( > "Filter old items, leaving only current order items", > new PreviousOrderItemFilter(), > Avros.tableOf(Avros.strings(), Avros.specifics(Item.class))); > [3] https://issues.apache.org/jira/browse/CRUNCH-192 > https://github.com/apache/crunch/commit/cbc7c2fb30ad0486e7ec60656c079c81e41eda2c > [4] http://mail-archives.apache.org/mod_mbox/crunch-user/201604.mbox/date -- This message was sent by Atlassian JIRA (v6.3.4#6332)