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 70CF219C96 for ; Wed, 20 Apr 2016 14:50:37 +0000 (UTC) Received: (qmail 83042 invoked by uid 500); 20 Apr 2016 14:50:37 -0000 Delivered-To: apmail-flink-user-archive@flink.apache.org Received: (qmail 82948 invoked by uid 500); 20 Apr 2016 14:50:37 -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 82938 invoked by uid 99); 20 Apr 2016 14:50:37 -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, 20 Apr 2016 14:50:37 +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 B372C1A03D0 for ; Wed, 20 Apr 2016 14:50:36 +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, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=radicalbit-io.20150623.gappssmtp.com Received: from mx2-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 5mlFQQG_Ec33 for ; Wed, 20 Apr 2016 14:50:32 +0000 (UTC) Received: from mail-vk0-f43.google.com (mail-vk0-f43.google.com [209.85.213.43]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 1C0BD5F1F0 for ; Wed, 20 Apr 2016 14:50:32 +0000 (UTC) Received: by mail-vk0-f43.google.com with SMTP id e185so61739126vkb.1 for ; Wed, 20 Apr 2016 07:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=radicalbit-io.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=UrBjEialsAfzcquxkjNthSRUnYmcCAkE1Hmjq5fAPR0=; b=hIWVDipgM6MAovaomPcv5myn4W0qVEa1IOULOJckWgOxirnR1INxgC+txZ5gD8s4Ve QEgbj579H7yrSk2ZId7H/lZ1oZvmP5qHAoXxrZ4N+YztXdLTr8aRDwXBiEh1ftKQUkju dYJrETrpTqT/MoqKNFEo2190y0bqyG1LZO2N5Cn+4xJg/43C0AtybsibXjbp4xxhBeFn lCZEincfKqQdCVv8wwWwnAQfZfr3YZv6T6ISBPjwzc99UNBI/7AEjrLSwRJVs1uWMZcF HBpSoWMJ+cUs2zq4R2/gFs2yfHHhtPrWKCc2NhIklw3QYn2twM05FBI0Z1YlplJMSVG/ TW4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=UrBjEialsAfzcquxkjNthSRUnYmcCAkE1Hmjq5fAPR0=; b=YlBCV4NKKvAodSg5mOrenDekX7GQ98gm0POB1TGbUer57Fucwo/2wVG3L950XytBBW RYZqQrEYg+wMAYRScj6ykv8usyU+tpkLLqTknheEMMxn29DN6Ry5e7O1qX/Rb1rtF/i0 9lQBsedBC0L3xYLaGMliwuYnt+c8kL9vZg8de6AjYxjdKApHkcnHb7KdnpkvzW5X2Vau hQ4Rhzdxb59eib9WhRwzRlrzYP8/jmBk274rPUFgUbWZc6CcFCVHXKe1N2WObfCmGDaV Lb76hQsp4gvH9/3FJT3mr7CXkOKtcFAE5bzTIvVXlt2faJBlAGft59VxQxHTS5J+g8k9 t9qg== X-Gm-Message-State: AOPr4FVppnk+38h4kXN8k1dN+UbQ+RE/0E/12dx4hUp7ujvj8WHUTGhXR/YuLNviTn2yWNOmwAM1KkTz3b9Sd3td MIME-Version: 1.0 X-Received: by 10.176.5.226 with SMTP id e89mr1830410uae.50.1461163831121; Wed, 20 Apr 2016 07:50:31 -0700 (PDT) Received: by 10.176.4.197 with HTTP; Wed, 20 Apr 2016 07:50:31 -0700 (PDT) In-Reply-To: References: <9aa900dc88ad3930b43ab7a0061eebda@webmail.toletum.org> Date: Wed, 20 Apr 2016 16:50:31 +0200 Message-ID: Subject: Re: Trying to detecting changes From: Stefano Baghino To: user@flink.apache.org Content-Type: multipart/alternative; boundary=94eb2c1241681cf43d0530ebb712 --94eb2c1241681cf43d0530ebb712 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Ok, thanks for the clarification Till. On Wed, Apr 20, 2016 at 4:46 PM, Till Rohrmann wrote= : > You could use CEP for that. First you would create a pattern of two state= s > which matches everything. In the select function you could then check > whether both elements are different. > > However, this would be a little bit of an overkill for this simple use > case. You could for example simply use a flat map operation which stores > the last seen element. Then whenever you see a different element you can > emit a change event. > > Cheers, > Till > > On Wed, Apr 20, 2016 at 2:43 PM, Stefano Baghino < > stefano.baghino@radicalbit.io> wrote: > >> Can the CEP library be used for this use case? >> >> On Wed, Apr 20, 2016 at 2:02 PM, Aljoscha Krettek >> wrote: >> >>> Hi, >>> this could be done by implementing a user function that keeps state or >>> by using windows with a custom Trigger. On only works, however, if you = only >>> have one Kafka partition and if your Flink job is executing with >>> parallelism=3D1. Otherwise we don't have any ordering guarantees on str= eams. >>> >>> Cheers, >>> Aljoscha >>> >>> On Wed, 20 Apr 2016 at 12:50 wrote: >>> >>>> Hi! I'm a beginner in Flink. >>>> I'm reading from a Kafka topic. In this topic, I receive a character >>>> each event, like that: >>>> >>>> Event.: 1 2 3 4 5 6 7 8 9... >>>> Data..: A A A B B B B C C... >>>> >>>> I would like to do a "trigger" when the character is different than >>>> before. For example: >>>> Event =C2=BA1 fire because of A is different to "null" >>>> Event =C2=BA4 fire because of B is different to A >>>> Event =C2=BA8 fire because of C is different to B >>>> >>>> Could it be possible? >>>> >>> >> >> >> -- >> BR, >> Stefano Baghino >> >> Software Engineer @ Radicalbit >> > > --=20 BR, Stefano Baghino Software Engineer @ Radicalbit --94eb2c1241681cf43d0530ebb712 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Ok, thanks for the clarification Till.

On Wed, Apr 20, 2016 at 4:46 PM= , Till Rohrmann <trohrmann@apache.org> wrote:
You could use CEP for that. First y= ou would create a pattern of two states which matches everything. In the se= lect function you could then check whether both elements are different.=C2= =A0

However, this would be a little bit of an overkill f= or this simple use case. You could for example simply use a flat map operat= ion which stores the last seen element. Then whenever you see a different e= lement you can emit a change event.

Cheers,
<= div>Till

On Wed, Apr 20, 2016 at 2:43 PM,= Stefano Baghino <stefano.baghino@radicalbit.io>= wrote:
Can the CEP libr= ary be used for this use case?
On Wed, Apr 20, 2016 at 2:02 PM, Aljoscha Kret= tek <aljoscha@apache.org> wrote:
Hi,
this could be done by implementing a user= function that keeps state or by using windows with a custom Trigger. On on= ly works, however, if you only have one Kafka partition and if your Flink j= ob is executing with parallelism=3D1. Otherwise we don't have any order= ing guarantees on streams.

Cheers,
Aljos= cha

On= Wed, 20 Apr 2016 at 12:50 <toletum@toletum.org> wrote:
Hi! I'm a beginner in Flink.
I'm reading from a Ka= fka topic. In this topic, I receive a character each event, like that:
<= br>Event.: 1 2 3 4 5 6 7 8 9...
Data..: A A A= B B B B C C...

I would like to do a "trigger" when= the character is different than before. For example:
Event =C2=BA1 fire= because of A is different to "null"
Event =C2=BA4 fire becaus= e of B is different to A
Event =C2=BA8 fire because of C is different to= B

Could it be possible?



<= /div>--
B= R,
Stefano Baghino

Software Engineer @ Radicalbit
=




--
=
BR,
Stef= ano Baghino

Software Engineer @ Radicalbit
--94eb2c1241681cf43d0530ebb712--