This is an automated email from the ASF dual-hosted git repository.
ibzib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 4b1c4aa [BEAM-10925] SQL AggregateFn: Separate mutable accumulator
from immutables.
new 199fea8 Merge pull request #13579 from ibzib/accumulators
4b1c4aa is described below
commit 4b1c4aadb16db36d5caf6a60186b981a6fffd503
Author: Kyle Weaver <[email protected]>
AuthorDate: Thu Dec 17 14:49:26 2020 -0800
[BEAM-10925] SQL AggregateFn: Separate mutable accumulator from immutables.
---
.../org/apache/beam/sdk/extensions/sql/udf/AggregateFn.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git
a/sdks/java/extensions/sql/udf/src/main/java/org/apache/beam/sdk/extensions/sql/udf/AggregateFn.java
b/sdks/java/extensions/sql/udf/src/main/java/org/apache/beam/sdk/extensions/sql/udf/AggregateFn.java
index 28ebf3b..1c1cece 100644
---
a/sdks/java/extensions/sql/udf/src/main/java/org/apache/beam/sdk/extensions/sql/udf/AggregateFn.java
+++
b/sdks/java/extensions/sql/udf/src/main/java/org/apache/beam/sdk/extensions/sql/udf/AggregateFn.java
@@ -54,17 +54,18 @@ public interface AggregateFn<
* Returns an accumulator representing the accumulation of all the input
values accumulated in the
* merging accumulators.
*
- * @param accumulators only the first accumulator may be modified and
returned for efficiency; the
- * other accumulators should not be mutated, because they may be shared
with other code and
- * mutating them could lead to incorrect results or data corruption.
+ * @param mutableAccumulator This accumulator may be modified and returned
for efficiency.
+ * @param immutableAccumulators These other accumulators should not be
mutated, because they may
+ * be shared with other code and mutating them could lead to incorrect
results or data
+ * corruption.
*/
- AccumT mergeAccumulators(Iterable<AccumT> accumulators);
+ AccumT mergeAccumulators(AccumT mutableAccumulator, Iterable<AccumT>
immutableAccumulators);
/**
* Returns the output value that is the result of combining all the input
values represented by
* the given accumulator.
*
- * @param accumulator can be modified for efficiency
+ * @param mutableAccumulator can be modified for efficiency
*/
- OutputT extractOutput(AccumT accumulator);
+ OutputT extractOutput(AccumT mutableAccumulator);
}