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 87597200B27 for ; Wed, 22 Jun 2016 13:43:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 861F9160A64; Wed, 22 Jun 2016 11:43:06 +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 CE0F7160A2E for ; Wed, 22 Jun 2016 13:43:05 +0200 (CEST) Received: (qmail 44642 invoked by uid 500); 22 Jun 2016 11:43:05 -0000 Mailing-List: contact commits-help@beam.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.incubator.apache.org Delivered-To: mailing list commits@beam.incubator.apache.org Received: (qmail 44633 invoked by uid 99); 22 Jun 2016 11:43:05 -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, 22 Jun 2016 11:43:05 +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 7EB3DC319B for ; Wed, 22 Jun 2016 11:43:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.649 X-Spam-Level: X-Spam-Status: No, score=-4.649 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.429] autolearn=disabled Received: from mx2-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 2HwPWfO0EFGC for ; Wed, 22 Jun 2016 11:42:59 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with SMTP id BD9305FB83 for ; Wed, 22 Jun 2016 11:42:58 +0000 (UTC) Received: (qmail 44496 invoked by uid 99); 22 Jun 2016 11:42:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2016 11:42:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DC9A22C0451 for ; Wed, 22 Jun 2016 11:42:57 +0000 (UTC) Date: Wed, 22 Jun 2016 11:42:57 +0000 (UTC) From: "Maximilian Michels (JIRA)" To: commits@beam.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (BEAM-365) TextIO withoutSharding causes Flink to throw IllegalStateException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 22 Jun 2016 11:43:06 -0000 [ https://issues.apache.org/jira/browse/BEAM-365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15344157#comment-15344157 ] Maximilian Michels commented on BEAM-365: ----------------------------------------- Thanks for reporting! Would you like to work on this [~kkl0u]? > TextIO withoutSharding causes Flink to throw IllegalStateException > ------------------------------------------------------------------ > > Key: BEAM-365 > URL: https://issues.apache.org/jira/browse/BEAM-365 > Project: Beam > Issue Type: Bug > Components: runner-flink > Affects Versions: 0.2.0-incubating > Reporter: Pawel Szczur > > The exception: > {code}java.lang.IllegalStateException: Shard name template '' only generated 1 distinct file names for 3 files{code} > The initial discussion took place some time ago, the {{withoutSharding}} was then silently ignored by the runner. > Explanation from Aljoscha Krettek: > {quote} > Hi, > the issue is a bit more complicated and involves the Beam sink API and the > Flink runner. > I'll have to get a bit into how Beam sinks work. The base class for sinks > is Sink (TextIO.write gets translated to Write.to(new TextSink())). > Write.to normally gets translated to three ParDo operations that cooperate > to do the writing: > - "Initialize": this does initial initialization of the Sink, this is run > only once, per sink, non-parallel. > - "WriteBundles": this gets an initialized sink on a side-input and the > values to write on the main input. This runs in parallel, so for Flink, if > you set parallelism=6 you'll get 6 parallel instances of this operation at > runtime. This operation forwards information about where it writes to > downstream. This does not write to the final file location but an > intermediate staging location. > - "Finalize": This gets the initialized sink on the main-input and and the > information about written files from "WriteBundles" as a side-input. This > also only runs once, non-parallel. Here we're writing the intermediate > files to a final location based on the sharding template. > The problem is that Write.to() and TextSink, as well as all other sinks, > are not aware of the number of shards. If you set "withoutSharding()" this > will set the shard template to "" (empty string) and the number of shards > to 1. "WriteBundles", however is not aware of this and will write 6 > intermediate files if you set parallelism=6. In "Finalize" we will copy an > intermediate file to the same final location 6 times based on the sharding > template. The end result is that you only get one of the six result shards. > The reason why this does only occur in the Flink runner is that all other > runners have special overrides for TextIO.Write and AvroIO.Write that kick > in if sharding control is required. So, for the time being this is a Flink > runner bug and we might have to introduce special overrides as well until > this is solved in the general case. > Cheers, > Aljoscha > {quote} > Original discussion: > http://mail-archives.apache.org/mod_mbox/incubator-beam-user/201606.mbox/%3CCAMdX74-VPUsNOc9NKue2A2tYXZisnHNZ7UkPWk82_TFexpnySg%40mail.gmail.com%3E -- This message was sent by Atlassian JIRA (v6.3.4#6332)