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 DEBC3200C54 for ; Wed, 12 Apr 2017 11:15:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DD47C160B8A; Wed, 12 Apr 2017 09:15:47 +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 3123D160B95 for ; Wed, 12 Apr 2017 11:15:47 +0200 (CEST) Received: (qmail 74037 invoked by uid 500); 12 Apr 2017 09:15:45 -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 73808 invoked by uid 500); 12 Apr 2017 09:15:44 -0000 Delivered-To: apmail-incubator-crunch-dev@incubator.apache.org Received: (qmail 73805 invoked by uid 99); 12 Apr 2017 09:15:44 -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; Wed, 12 Apr 2017 09:15:44 +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 E7F91CF206 for ; Wed, 12 Apr 2017 09:15:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 5W-Iv9RfWtZo for ; Wed, 12 Apr 2017 09:15:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 04F595FB5D for ; Wed, 12 Apr 2017 09:15:43 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1C8D9E0A6C for ; Wed, 12 Apr 2017 09:15:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id CDF292406A for ; Wed, 12 Apr 2017 09:15:41 +0000 (UTC) Date: Wed, 12 Apr 2017 09:15:41 +0000 (UTC) From: "Xavier (JIRA)" To: crunch-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CRUNCH-642) Enable numReducers option for methods in Distinct MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 12 Apr 2017 09:15:48 -0000 [ https://issues.apache.org/jira/browse/CRUNCH-642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xavier updated CRUNCH-642: -------------------------- Attachment: CRUNCH-642-Enable-GroupingOptions-for-Distinct-operations.patch Hey [~joshwills], I noticed my change introduces a major bug when running the distinct operation with a non-memory PCollection. My apologies for this terrible mistake. In attachment is an additional patch that solves this by passing along the GroupOptions object instead of a numReducers integer. This will be more flexible and avoids bugs like this popping up. I also added tests (both unit and integration tests) to ensure the fix is now working. > Enable numReducers option for methods in Distinct > ------------------------------------------------- > > Key: CRUNCH-642 > URL: https://issues.apache.org/jira/browse/CRUNCH-642 > Project: Crunch > Issue Type: Improvement > Components: Core > Affects Versions: 0.14.0 > Reporter: Xavier > Assignee: Josh Wills > Priority: Trivial > Attachments: CRUNCH-642-Enable-GroupingOptions-for-Distinct-operations.patch, CRUNCH-642.patch > > > The {{groupByKey}} invocation in the {{Distinct}} class currently uses the default (recommended) number of reducers without providing an option to override this: > {code} > public static PCollection distinct(PCollection input, int flushEvery) { > Preconditions.checkArgument(flushEvery > 0); > PType pt = input.getPType(); > PTypeFamily ptf = pt.getFamily(); > return input > .parallelDo("pre-distinct", new PreDistinctFn(flushEvery, pt), ptf.tableOf(pt, ptf.nulls())) > .groupByKey() > .parallelDo("post-distinct", new PostDistinctFn(), pt); > } > {code} > Would it be possible to enhance this method such that it is possible to customize the number of reducers? Either explicitly or via a {{GroupingOptions}} object. -- This message was sent by Atlassian JIRA (v6.3.15#6346)