You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Till Rohrmann (JIRA)" <ji...@apache.org> on 2016/08/01 13:01:20 UTC

[jira] [Commented] (FLINK-3414) Add Scala API for CEP's pattern definition

    [ https://issues.apache.org/jira/browse/FLINK-3414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15402000#comment-15402000 ] 

Till Rohrmann commented on FLINK-3414:
--------------------------------------

Hi [~ivan.mushketyk], great to hear that you want to work on this issue.

The Scala support was partly added with FLINK-3708. However, we didn't add a Scala DSL for the pattern definition yet. This means having a more succinct way to specify in a more scalaesque way. The design for this language would be the first step and should be discussed prior to starting the implementation.

The symbol "->" means "followedBy" and "||" is the or operator. The DSL example does not have to represent the result of the design. It was intended to be an inspiration how a future DSL could look like. So feel free to come up with your own operator names to represent the different Pattern API concepts.

> Add Scala API for CEP's pattern definition
> ------------------------------------------
>
>                 Key: FLINK-3414
>                 URL: https://issues.apache.org/jira/browse/FLINK-3414
>             Project: Flink
>          Issue Type: Improvement
>          Components: CEP
>    Affects Versions: 1.0.0
>            Reporter: Till Rohrmann
>            Priority: Minor
>
> Currently, the CEP library only supports a Java API to specify complex event patterns. In order to make it a bit less verbose for Scala users, it would be nice to also add a Scala API for the CEP library. 
> A Scala API would also allow to pass Scala's anonymous functions as filter conditions or as a select function, for example, or to use partial functions to distinguish between different events.
> Furthermore, the Scala API could be designed to feel a bit more like a DSL:
> {code}
> begin "start" where _.id >= 42 -> "middle_1" as classOf[Subclass] || "middle_2" where _.name equals "foobar" -> "end" where x => x.id <= x.volume
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)