GitHub user rmetzger opened a pull request:
https://github.com/apache/flink/pull/769
[FLINK-2135] Fix faulty cast to GroupReduceFunction
There seem to be two variants of that tuple unwrapping thing, one
combinable, the other one non-combinable.
These unwrapping things use a helper class called `WrappingFunction`, which
expects the type of the user function.
In this case, we need a combinable group reduce function. It seems that
only RichGroupReduceFunction is combinable AND a GroupReduceFunction at the
same time.
But users can also implement non-rich combinable group reduce functions (by
implementing both interfaces).
The `PlanUnwrappingSortedReduceGroupOperator` was just casting the user
function to a `RichGroupReduceFunction`, which will fail if the UDF is not a
Rich one.
To avoid making the code uglier than it already is, I've decided to cast
the wrapped function to a `GroupCombineFunction` for calling the combiner. The
`TupleUnwrappingGroupCombinableGroupReducer` is only called for Combinable UDFs
anyways.
Lets see if travis gives me green light for this fix.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rmetzger/flink flink2135
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/769.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 #769
----
commit f4e66bd84ab7f0c47505336217f1ed3e86d4069c
Author: Robert Metzger <[email protected]>
Date: 2015-06-03T13:52:12Z
[FLINK-2135] Fix faulty cast to GroupReduceFunction
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---