[
https://issues.apache.org/jira/browse/GEARPUMP-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15797050#comment-15797050
]
ASF GitHub Bot commented on GEARPUMP-249:
-----------------------------------------
GitHub user manuzhang opened a pull request:
https://github.com/apache/incubator-gearpump/pull/127
[GEARPUMP-249] Force eager evaluation on chained operations
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
- [ ] Make sure the commit message is formatted like:
`[GEARPUMP-<Jira issue #>] Meaningful description of pull request`
- [ ] Make sure tests pass via `sbt clean test`.
- [ ] Make sure old documentation affected by the pull request has been
updated and new documentation added for new functionality.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/manuzhang/incubator-gearpump eager-eval
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-gearpump/pull/127.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #127
----
commit ddc1e98877326740481d76bbfb5c1646bd79fd4f
Author: manuzhang <[email protected]>
Date: 2017-01-04T03:18:40Z
[GEARPUMP-249] Force eager evaluation on chained operations
----
> reduce is not executed when following flatMap in Stream DSL
> -----------------------------------------------------------
>
> Key: GEARPUMP-249
> URL: https://issues.apache.org/jira/browse/GEARPUMP-249
> Project: Apache Gearpump
> Issue Type: Bug
> Components: streaming
> Affects Versions: 0.8.2
> Reporter: Manu Zhang
> Assignee: Manu Zhang
> Fix For: 0.8.3
>
>
> The issue can be reproduced if a redundant {{map}} is added between
> {{groupBy}} and {{sum}}
> {code}
> app.source(data.lines.toList, 1, "source").
> // word => (word, count)
> flatMap(line => line.split("[\\s]+")).map((_, 1)).
> // (word, count1), (word, count2) => (word, count1 + count2)
> groupByKey().sum.log
> {code}
> The problem is with {{AndThen#process}} method, where {{flatMap}} is lazily/
> never executed.
> {code}
> override def process(value: IN): TraversableOnce[OUT] = {
> first.process(value).flatMap(second.process)
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)