Return-Path: X-Original-To: apmail-crunch-commits-archive@www.apache.org Delivered-To: apmail-crunch-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 11E3E105A8 for ; Thu, 25 Apr 2013 20:17:16 +0000 (UTC) Received: (qmail 61216 invoked by uid 500); 25 Apr 2013 20:17:16 -0000 Delivered-To: apmail-crunch-commits-archive@crunch.apache.org Received: (qmail 61169 invoked by uid 500); 25 Apr 2013 20:17:15 -0000 Mailing-List: contact commits-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 commits@crunch.apache.org Received: (qmail 61149 invoked by uid 99); 25 Apr 2013 20:17:15 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 20:17:15 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 57BAC8816C0; Thu, 25 Apr 2013 20:17:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jwills@apache.org To: commits@crunch.apache.org Message-Id: <885ba4b2f8834cbb80b0a57f58a306d5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: CRUNCH-198: Update CoGroupIT to run on hadoop-2 by ignoring ordering of cogrouped elements in the output Date: Thu, 25 Apr 2013 20:17:15 +0000 (UTC) Updated Branches: refs/heads/master 7c536c395 -> f1e877d4f CRUNCH-198: Update CoGroupIT to run on hadoop-2 by ignoring ordering of cogrouped elements in the output Project: http://git-wip-us.apache.org/repos/asf/crunch/repo Commit: http://git-wip-us.apache.org/repos/asf/crunch/commit/f1e877d4 Tree: http://git-wip-us.apache.org/repos/asf/crunch/tree/f1e877d4 Diff: http://git-wip-us.apache.org/repos/asf/crunch/diff/f1e877d4 Branch: refs/heads/master Commit: f1e877d4f1627a8289d42072202556a42e56e97c Parents: 7c536c3 Author: Josh Wills Authored: Thu Apr 25 13:17:02 2013 -0700 Committer: Josh Wills Committed: Thu Apr 25 13:17:02 2013 -0700 ---------------------------------------------------------------------- .../it/java/org/apache/crunch/lib/CogroupIT.java | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/crunch/blob/f1e877d4/crunch-core/src/it/java/org/apache/crunch/lib/CogroupIT.java ---------------------------------------------------------------------- diff --git a/crunch-core/src/it/java/org/apache/crunch/lib/CogroupIT.java b/crunch-core/src/it/java/org/apache/crunch/lib/CogroupIT.java index 4b28da7..0d8b2b8 100644 --- a/crunch-core/src/it/java/org/apache/crunch/lib/CogroupIT.java +++ b/crunch-core/src/it/java/org/apache/crunch/lib/CogroupIT.java @@ -42,8 +42,9 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Maps; public class CogroupIT { @@ -84,8 +85,13 @@ public class CogroupIT { PTable, Collection>> cg = Cogroup.cogroup(kv1, kv2); - Map, Collection>> actual = cg.materializeToMap(); - + Map, Collection>> result = cg.materializeToMap(); + Map, Collection>> actual = Maps.newHashMap(); + for (Map.Entry, Collection>> e : result.entrySet()) { + Collection one = ImmutableSet.copyOf(e.getValue().first()); + Collection two = ImmutableSet.copyOf(e.getValue().second()); + actual.put(e.getKey(), Pair.of(one, two)); + } Map, Collection>> expected = ImmutableMap.of( "a", Pair.of(coll("1-1", "1-4"), coll()), "b", Pair.of(coll("1-2"), coll("2-1")), @@ -106,7 +112,7 @@ public class CogroupIT { } private static Collection coll(String... values) { - return ImmutableList.copyOf(values); + return ImmutableSet.copyOf(values); } }