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 E901B200CCC for ; Fri, 21 Jul 2017 16:31:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E769116D486; Fri, 21 Jul 2017 14:31:56 +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 112E516D484 for ; Fri, 21 Jul 2017 16:31:55 +0200 (CEST) Received: (qmail 36072 invoked by uid 500); 21 Jul 2017 14:31:55 -0000 Mailing-List: contact user-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@beam.apache.org Delivered-To: mailing list user@beam.apache.org Received: (qmail 36062 invoked by uid 99); 21 Jul 2017 14:31:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2017 14:31:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A01D4C00CE for ; Fri, 21 Jul 2017 14:31:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.198 X-Spam-Level: * X-Spam-Status: No, score=1.198 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=seznam.cz Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id kLcCuy_Alt1Y for ; Fri, 21 Jul 2017 14:31:52 +0000 (UTC) Received: from mxc2.seznam.cz (mxc2.seznam.cz [77.75.77.23]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 176565F56A for ; Fri, 21 Jul 2017 14:31:51 +0000 (UTC) Received: from email.seznam.cz by email-smtpc13a.ng.seznam.cz (email-smtpc13a.ng.seznam.cz [10.23.11.135]) id 74ef44a1a2c9655a74f8bf4b; Fri, 21 Jul 2017 16:31:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seznam.cz; s=beta; t=1500647504; bh=3KDKJnvL1r/WOFYoxZ9cYcg+YirjvM04Q/MitNMKaXY=; h=Received:Subject:To:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language; b=T6KKHrTalfYHv6FmuLsssuO56FvN+5Wjz5fEgWnzrGIxjYx396aeg54w6st5zWAk+ GRBmwFd1reBLMD4h3ozxYWjxq+8qlXWj22ZOeOohMLzMS0VV8HhLN7qfclr3LjxV8m tNzbEyfb82tIxtZXpO6i+zLi0v5r+4hYGXSwEVvU= Received: from [10.0.1.10] (176-114-240-37.rychlydrat.cz [176.114.240.37]) by email-relay30.ng.seznam.cz (Seznam SMTPD 1.3.60) with ESMTP; Fri, 21 Jul 2017 16:31:43 +0200 (CEST) Subject: Re: Terasort-like pipeline To: user@beam.apache.org References: <46519901-a72c-5354-0c4b-7901197c064e@seznam.cz> From: =?UTF-8?Q?Jan_Lukavsk=c3=bd?= Message-ID: <1d0d4abf-8697-d180-de64-a45504f33bd0@seznam.cz> Date: Fri, 21 Jul 2017 16:31:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------4036E0A7BDA2EE5E9A7D5679" Content-Language: en-US archived-at: Fri, 21 Jul 2017 14:31:57 -0000 This is a multi-part message in MIME format. --------------4036E0A7BDA2EE5E9A7D5679 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi, thanks for answer. I understand that Beam does not want to incorporate in the model a way to handle parallelism (because it is left to the runner to decide, which I find good). But there are some use-cases where it would be beneficial to force *sequential* processing. That is to make sure that certain PCollection (or, to state it exactly, each window of a PCollection) is processed entirely by a single (fault tolerant) instance. The terasort pipeline would then be realizable and I don't think that even affects the runners so much. Many of them (actuall all I know :)) nevertheless have this option to process a "partition" by a single "mapper" or "processor". Would it be possible to add a sequential form of ParDo into the model? Or is it strictly against the philosophy? Jan On 07/19/2017 10:48 PM, Vikas RK wrote: > The Beam model doesn't support global sorting, [1] discusses in detail > that you might find useful. > > [1] > https://lists.apache.org/thread.html/bc0e65a3bb653b8fd0db96bcd4c9da5af71a71af5a5639a472167808@1464278191@%3Cdev.beam.apache.org%3E > > On 19 July 2017 at 02:45, Jan Lukavský > wrote: > > Hi all, > > I'm trying to get better understanding of Beam's internals for the > sake of integration with Euphoria API as a DSL ([1]), and while > trying to wrap Euphoria's abstractions of outputs, I came across a > little issue, that I'm currently a little stuck with. The issue is > not important to this question, but it basically boils down to the > following: how could I write a Pipeline, that works like a > terasort benchmark ([2]). That is - I have a randomly distributed > dataset (let's suppose batch case for simplicity), and I want to > sort it so that on output I will have N totally sorted partitions. > This implies that I can somehow compare the partitions (or > partition IDs) on output, so that the following holds: For each > partitions X and Y, if partition X is less to partition Y, then > all elements in partition X are less or equal to all elements in > partition Y. > > So far, I have not been able to find a clean solution in Beam. I > can do a group-by-key operation (where the *key* would be > partition Id), and then sort the data within the key. But I have > issues outputting the sorted data by a ParDo (because it can run > in parallel in theory, and therefore I can either loose the > sorting, or run to concurrency issues). > > Would anyone have an idea about how to do this? > > Thanks for any comments, > > Jan > > [1] https://github.com/seznam/euphoria > > > [2] > https://hadoop.apache.org/docs/r2.7.1/api/org/apache/hadoop/examples/terasort/package-summary.html > > > --------------4036E0A7BDA2EE5E9A7D5679 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi,

thanks for answer. I understand that Beam does not want to incorporate in the model a way to handle parallelism (because it is left to the runner to decide, which I find good). But there are some use-cases where it would be beneficial to force *sequential* processing. That is to make sure that certain PCollection (or, to state it exactly, each window of a PCollection) is processed entirely by a single (fault tolerant) instance. The terasort pipeline would then be realizable and I don't think that even affects the runners so much. Many of them (actuall all I know :)) nevertheless have this option to process a "partition" by a single "mapper" or "processor".

Would it be possible to add a sequential form of ParDo into the model? Or is it strictly against the philosophy?

 Jan


On 07/19/2017 10:48 PM, Vikas RK wrote:
The Beam model doesn't support global sorting, [1] discusses in detail that you might find useful.  


On 19 July 2017 at 02:45, Jan Lukavský <je.ik@seznam.cz> wrote:
Hi all,

I'm trying to get better understanding of Beam's internals for the sake of integration with Euphoria API as a DSL ([1]), and while trying to wrap Euphoria's abstractions of outputs, I came across a little issue, that I'm currently a little stuck with. The issue is not important to this question, but it basically boils down to the following: how could I write a Pipeline, that works like a terasort benchmark ([2]). That is - I have a randomly distributed dataset (let's suppose batch case for simplicity), and I want to sort it so that on output I will have N totally sorted partitions. This implies that I can somehow compare the partitions (or partition IDs) on output, so that the following holds: For each partitions X and Y, if partition X is less to partition Y, then all elements in partition X are less or equal to all elements in partition Y.

So far, I have not been able to find a clean solution in Beam. I can do a group-by-key operation (where the *key* would be partition Id), and then sort the data within the key. But I have issues outputting the sorted data by a ParDo (because it can run in parallel in theory, and therefore I can either loose the sorting, or run to concurrency issues).

Would anyone have an idea about how to do this?

Thanks for any comments,

 Jan

[1] https://github.com/seznam/euphoria

[2] https://hadoop.apache.org/docs/r2.7.1/api/org/apache/hadoop/examples/terasort/package-summary.html



--------------4036E0A7BDA2EE5E9A7D5679--