Return-Path: X-Original-To: apmail-flink-user-archive@minotaur.apache.org Delivered-To: apmail-flink-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8427619B2C for ; Wed, 9 Mar 2016 11:57:31 +0000 (UTC) Received: (qmail 63225 invoked by uid 500); 9 Mar 2016 11:57:31 -0000 Delivered-To: apmail-flink-user-archive@flink.apache.org Received: (qmail 63128 invoked by uid 500); 9 Mar 2016 11:57:31 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@flink.apache.org Delivered-To: mailing list user@flink.apache.org Received: (qmail 63118 invoked by uid 99); 9 Mar 2016 11:57:31 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2016 11:57:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CAF0D1A0CCE for ; Wed, 9 Mar 2016 11:57:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.299 X-Spam-Level: * X-Spam-Status: No, score=1.299 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Ylc348krPILN for ; Wed, 9 Mar 2016 11:57:28 +0000 (UTC) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id C44D05FBA6 for ; Wed, 9 Mar 2016 11:57:27 +0000 (UTC) Received: by mail-io0-f176.google.com with SMTP id n190so62807606iof.0 for ; Wed, 09 Mar 2016 03:57:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to; bh=ZRgFaH6n+KOspX9pA3vjahUwt9JyoiJezy1/oiP3YWE=; b=0F/4ODDJ3yGUVigEivKzFhkm0r684t5G9XDP0V27Vmp/HNtThhNYJbvaMpl5eE6x+2 387DIoHuXLXE3kswlzeituHUxKq4HT+ylp578DCTDDvzXl6NI4+1jHqt2x9FdRSdLl0t IK6fgJuAjp2XTrBifjg4JQSYT8mKFkzmOwUSQ3TFzD+TF+lQms+dpB7XP4IHrvJZsuF5 sbDaDLt/GesqGSFRPmR6SBHsa0KmirqYaAIXowbkrIKX/Zu52T3v+l74d7neF0xHY7J1 oVJOCnWfX4TOMDKh3ruK3hTwA7Pp5CQz5R71XV4d4hRG+BqxuUP7ctmiWSjPt08Sf6Qa H7JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to; bh=ZRgFaH6n+KOspX9pA3vjahUwt9JyoiJezy1/oiP3YWE=; b=fi38/K670BVO68gUIdDkOa+DNxsYnYQqdP/u0DcD8g5PBJPX+swMftRi+xosQ32oPN 1bO/k3ARAa/E/Dz+wDmqt5n3IER/6AOx7+FLah+kZubb9vlbfcH5QxRIAbd0NjdxkEmA 5VMS/xeEAJOtkC2JhnmEm2pu+0kPS/ny01BF8a97S64Fkp4xeFrm7nnJkdEi7JpayiP8 BrRIqecjEHfrQm8dORkk1QcpEeIJf5Oi5xt9DCTUr0HPpPCOv2my5KWAdCQhMOIEnm75 2MgaZYlykQKYhMx+nXNWoXVY34IhR9nSRGb8x5x7F5wB4vVZ7PCUxbHP5vspEt2+xJIS Drzw== X-Gm-Message-State: AD7BkJInghVT/T+aF4Jj1auP7uoinHyGRvA1SC7IReFIgELebB1TddZXu+MCujJ1dlPB8PPzO9TN6/bK7o62gA== MIME-Version: 1.0 X-Received: by 10.107.185.134 with SMTP id j128mr20835070iof.23.1457524646821; Wed, 09 Mar 2016 03:57:26 -0800 (PST) Sender: ewenstephan@gmail.com Received: by 10.107.12.79 with HTTP; Wed, 9 Mar 2016 03:57:26 -0800 (PST) In-Reply-To: References: Date: Wed, 9 Mar 2016 12:57:26 +0100 X-Google-Sender-Auth: 44od7FJS-XzgEgN5t3q-3pey02g Message-ID: Subject: Re: keyBy using custom partitioner From: Stephan Ewen To: user@flink.apache.org Content-Type: multipart/alternative; boundary=94eb2c0810acd34b0b052d9c6666 --94eb2c0810acd34b0b052d9c6666 Content-Type: text/plain; charset=UTF-8 Hi! You can currently not override the hash function used by "keyBy()". The reason is that this function is used in multiple places, for the stream partitioning, and also for the partitioning of state. Both have to be aligned. What you can do is use "partitionCustom(...)" to use an arbitrary partitioner. However, you cannot window or access state using that... If you want to partition in a particular way and use windows after that, you would currently have to do something like a a map function that generates a special key, and then use keyBy() on that. Greetings, Stephan On Wed, Mar 9, 2016 at 10:07 AM, madhu phatak wrote: > Hi, > How to use a custom partitioner in keyBy operation? As of now it's using > hash partitioner to load balance across parallel tasks. I tried custom > partitioning the schema before calling keyBy operation. It doesn't seem to > preserve that partition. > > -- > Regards, > Madhukara Phatak > http://datamantra.io/ > --94eb2c0810acd34b0b052d9c6666 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi!

You can currently not override the = hash function used by "keyBy()". The reason is that this function= is used in multiple places, for the stream partitioning, and also for the = partitioning of state. Both have to be aligned.

Wh= at you can do is use "partitionCustom(...)" to use an arbitrary p= artitioner. However, you cannot window or access state using that...
<= div>
If you want to partition in a particular way and use win= dows after that, you would currently have to do something like a a map func= tion that generates a special key, and then use keyBy() on that.
=
Greetings,
Stephan


On Wed, Mar 9, 2016 at= 10:07 AM, madhu phatak <phatak.dev@gmail.com> wrote:
=
Hi,
How to use a custom= partitioner in keyBy operation? As of now it's using hash partitioner = to load balance across parallel tasks. I tried custom partitioning the sche= ma before calling keyBy operation. It doesn't seem to preserve that par= tition.=C2=A0

--
Regards,
Madh= ukara Phatak
http://= datamantra.io/

--94eb2c0810acd34b0b052d9c6666--