Github user StephanEwen commented on a diff in the pull request:
https://github.com/apache/flink/pull/1464#discussion_r48017305
--- Diff:
flink-tests/src/test/java/org/apache/flink/test/javaApiOperators/ObjectReuseITCase.java
---
@@ -124,26 +125,30 @@ public static String runProgram(int progId, String
resultPath) throws Exception
env.execute();
// return expected result
- return "a,100\n";
+ return "a,60\n";
}
case 2: {
+ // Global reduce
final ExecutionEnvironment env =
ExecutionEnvironment.getExecutionEnvironment();
- env.getConfig().enableObjectReuse();
DataSet<Tuple2<String, Integer>> input =
env.readCsvFile(inReducePath).types(String.class,
Integer.class).setParallelism(1);
- DataSet<Tuple2<String, Integer>> result = input
- .reduce(new
ReduceFunction<Tuple2<String, Integer>>() {
+ DataSet<Tuple2<String, Integer>> result =
input.reduce(new ReduceFunction<Tuple2<String, Integer>>() {
@Override
public Tuple2<String,
Integer> reduce(
Tuple2<String, Integer> value1,
Tuple2<String, Integer> value2) throws Exception {
- value2.f1 +=
value1.f1;
- return value2;
+ if (value1.f1 %
2 == 0) {
--- End diff --
How about changing this to `% 3`, so that it does not "accidentally" work
by perfectly following the rotation of the "reuse1" and "reuse2" variables in
the driver?
---
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.
---