[
https://issues.apache.org/jira/browse/BEAM-1948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15972757#comment-15972757
]
ASF GitHub Bot commented on BEAM-1948:
--------------------------------------
GitHub user echauchot opened a pull request:
https://github.com/apache/beam/pull/2573
[BEAM-1948] Add protection against null pointer exception if aggregator key
is not present in aggregatorSteps in
DirectRunner.DirectPipelineResult.getAggregatorValues(aggregator)
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
- [X] Make sure the PR title is formatted like:
`[BEAM-<Jira issue #>] Description of pull request`
- [X] Make sure tests pass via `mvn clean verify`. (Even better, enable
Travis-CI on your fork and ensure the whole test matrix passes).
- [X] Replace `<Jira issue #>` in the title with the actual Jira issue
number, if there is one.
- [X] If this contribution is large, please file an Apache
[Individual Contributor License
Agreement](https://www.apache.org/licenses/icla.pdf).
---
I have run into a case in which `aggregator` key is not present in
`aggregatorSteps` in
`DirectRunner.DirectPipelineResult.getAggregatorValues(aggregator)` causing a
null pointer exception. It might be because, in the user code, the
`aggregator` is created but the `aggregator.addValue()` is never called
(aggregator is a fatal errors counter).
This PR is just a simple protection against this error.
R: @tgroh
CC: @jbonofre
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/echauchot/beam
BEAM-1948-Null_pointer_exception_in_DirectRunner.DirectPipelineResult.getAggregatorValues
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/beam/pull/2573.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 #2573
----
----
> Null pointer exception in
> DirectRunner.DirectPipelineResult.getAggregatorValues()
> ---------------------------------------------------------------------------------
>
> Key: BEAM-1948
> URL: https://issues.apache.org/jira/browse/BEAM-1948
> Project: Beam
> Issue Type: Bug
> Components: runner-direct
> Reporter: Etienne Chauchot
> Assignee: Etienne Chauchot
> Priority: Minor
>
> Running query3 of nexmark
> (https://github.com/iemejia/beam/blob/BEAM-160-nexmark/integration/java/nexmark/src/main/java/org/apache/beam/integration/nexmark/queries/Query3Model.java)
> in streaming mode (UnboundedSource) on Direct runner generates a null
> pointer exception in {code}
> DirectRunner.DirectPipelineResult.getAggregatorValues() {code}
> In
> {code} if (steps.contains(transform.getTransform())) {code}
> {code} steps == null {code}
> to reproduce it :
> run {code} NexmarkDirectDriver.main() {code}
> with options
> {code}
> --query=3 --streaming=true --numEventGenerators=4 --manageResources=false
> --monitorJobs=true --enforceEncodability=false --enforceImmutability=false
> {code}
> see the repo in link above
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)