You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2020/12/21 22:54:31 UTC

[beam] branch release-2.27.0 updated: [BEAM-10925] SQL AggregateFn: Separate mutable accumulator from immutables.

This is an automated email from the ASF dual-hosted git repository.

pabloem pushed a commit to branch release-2.27.0
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/release-2.27.0 by this push:
     new 2948c7d  [BEAM-10925] SQL AggregateFn: Separate mutable accumulator from immutables.
     new 21372b5  Merge pull request #13583 from [BEAM-10925] [cherry-pick] SQL AggregateFn: Separate mutable accumulator from immut…
2948c7d is described below

commit 2948c7de0da977c886e7528f7a1a79de9560802d
Author: Kyle Weaver <kc...@google.com>
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);
 }