From issues-return-170888-archive-asf-public=cust-asf.ponee.io@flink.apache.org Fri Jun 8 09:47:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 36EE0180608 for ; Fri, 8 Jun 2018 09:47:04 +0200 (CEST) Received: (qmail 61389 invoked by uid 500); 8 Jun 2018 07:47:03 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 61378 invoked by uid 99); 8 Jun 2018 07:47:03 -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; Fri, 08 Jun 2018 07:47:03 +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 BA6ED1A3FE0 for ; Fri, 8 Jun 2018 07:47:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Flx67BrMa6mN for ; Fri, 8 Jun 2018 07:47:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1358C5F4A9 for ; Fri, 8 Jun 2018 07:47:01 +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 80F54E02F1 for ; Fri, 8 Jun 2018 07:47:00 +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 1303221097 for ; Fri, 8 Jun 2018 07:47:00 +0000 (UTC) Date: Fri, 8 Jun 2018 07:47:00 +0000 (UTC) From: "Lucas Resch (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-9547) CEP pattern not called on windowed stream MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-9547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16505799#comment-16505799 ] Lucas Resch commented on FLINK-9547: ------------------------------------ [~dawidwys] I tried both suggestions you made: h5. Run with {{ProcessingTime}} The issue is not existant as you expected. h5. Implement Watermarking In my initial code example and not the artificial one we are already using a custom Watermark and Timestamp generator. It is defined like this: {code:java} public class CustomWatermarkEmitter implements AssignerWithPunctuatedWatermarks { @Nullable @Override public Watermark checkAndGetNextWatermark(T logEvent, long l) { return new Watermark(l); } @Override public long extractTimestamp(T logEvent, long l) { return ((RobotData) logEvent).getSendTimeStamp(); } } {code} Therefore I tried adding a simple Emitter for this artifical example to see if it fixes the problem. The result was that it behaves the same as without. I defined it like this: {code:java} objectDataStreamSource.assignTimestampsAndWatermarks(new AssignerWithPunctuatedWatermarks() { @Override public Watermark checkAndGetNextWatermark(Integer integer, long l) { return new Watermark(l); } @Override public long extractTimestamp(Integer integer, long l) { return new Date().getTime(); } }); {code} h5. Regarding emmitting enough events I would expect that for a sliding window of 2 with a slide of 1 I would need at least 3 events to close the window once. Is that a wrong assumption? > CEP pattern not called on windowed stream > ----------------------------------------- > > Key: FLINK-9547 > URL: https://issues.apache.org/jira/browse/FLINK-9547 > Project: Flink > Issue Type: Bug > Components: CEP > Affects Versions: 1.3.2, 1.5.0 > Reporter: Lucas Resch > Priority: Major > > When trying to match a pattern on a stream that was windowed the pattern will not be called. The following shows example code where the issue was noticed: > {code:java} > // Set up stream > SingleOutputStreamOperator forces = ... > .filter(new FilterForcesFunction()) > .process(new ProcessForcesFunction()); > // Define mock pattern > Pattern forcesMock = Pattern.begin("start").where(new SimpleCondition() { > @Override > public boolean filter(ForceZ value) { > // This is called as expected > return true; > } > }); > // Print pattern results > // This actually prints all incoming events as expected > CEP.pattern(forcesMock, mock) > .select(new PatternSelectFunction() { > @Override > public ForceZ select(Map> pattern){ > return pattern.get("start").get(0); > } > }).print(); > // Create another stream based on a sliding window over the input stream > SingleOutputStreamOperator intervals = forces > .countWindowAll(2, 1) > .process(new ForceWindowFunction()); > // Define mock pattern > Pattern intervalMock = Pattern.begin("start").where(new SimpleCondition() { > @Override > public boolean filter(Interval value) throws Exception { > // This is never called > return true; > } > }); > // Print pattern results > // Doesn't print anything since the mock condition is never called > CEP.pattern(intervals, intervalMock) > .select(new PatternSelectFunction() { > @Override > public Interval select(Map> pattern) throws Exception { > return pattern.get("start").get(0); > } > }).print(); > {code} > Either I'm doing something wrong or this is a major bug. -- This message was sent by Atlassian JIRA (v7.6.3#76005)