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

ASF GitHub Bot commented on FLINK-10980:
----------------------------------------

asfgit closed pull request #7158: [FLINK-10980][docs] Fix Iterable Scala code 
in CEP part
URL: https://github.com/apache/flink/pull/7158
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/dev/libs/cep.md b/docs/dev/libs/cep.md
index c8e836349ef..ce9a9c3d72b 100644
--- a/docs/dev/libs/cep.md
+++ b/docs/dev/libs/cep.md
@@ -1527,8 +1527,8 @@ The events for a given pattern are ordered by timestamp. 
The reason for returnin
 
 {% highlight scala %}
 def selectFn(pattern : Map[String, Iterable[IN]]): OUT = {
-    val startEvent = pattern.get("start").get.next
-    val endEvent = pattern.get("end").get.next
+    val startEvent = pattern.get("start").get.head
+    val endEvent = pattern.get("end").get.head
     OUT(startEvent, endEvent)
 }
 {% endhighlight %}
@@ -1539,8 +1539,8 @@ The `flatSelect` method is similar to the `select` 
method. Their only difference
 
 {% highlight scala %}
 def flatSelectFn(pattern : Map[String, Iterable[IN]], collector : 
Collector[OUT]) = {
-    val startEvent = pattern.get("start").get.next
-    val endEvent = pattern.get("end").get.next
+    val startEvent = pattern.get("start").get.head
+    val endEvent = pattern.get("end").get.head
     for (i <- 0 to startEvent.getValue) {
         collector.collect(OUT(startEvent, endEvent))
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Wrong statement in CEP Scala part
> ---------------------------------
>
>                 Key: FLINK-10980
>                 URL: https://issues.apache.org/jira/browse/FLINK-10980
>             Project: Flink
>          Issue Type: Bug
>          Components: CEP, Documentation
>    Affects Versions: 1.6.2
>            Reporter: DuBin
>            Priority: Minor
>              Labels: pull-request-available
>
> The CEP 'Selecting from patterns' part of Doc gives wrong code.
> {{ val startEvent = pattern.get("start").get.next }}
> {{val endEvent = pattern.get("end").get.next}}
> {{should be .get.head}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to