@@ -0,0 +1,2668 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.beam.sdk.extensions.sql.udf;%0A%0Aimport org.checkerframework.checker.nullness.qual.Nullable;%0A%0A/**%0A * An aggregate function that can be executed as part of a SQL query.%0A *%0A * %3Cp%3EAggregateFn contains a subset of the functionality of %7B@code%0A * org.apache.beam.sdk.transforms.Combine.CombineFn%7D.%0A *%0A * %3Cp%3EAggregateFn is %3Cstrong%3Eexperimental%3C/strong%3E. Compatibility is not guaranteed across Beam%0A * versions.%0A *%0A * @param %3CInputT%3E type of input values%0A * @param %3CAccumT%3E type of mutable accumulator values%0A * @param %3COutputT%3E type of output values%0A */%0Apublic interface AggregateFn%3C%0A    InputT extends @Nullable Object,%0A    AccumT extends @Nullable Object,%0A    OutputT extends @Nullable Object%3E %7B%0A%0A  /**%0A   * Returns a new, mutable accumulator value, representing the accumulation of zero input values.%0A   */%0A  AccumT createAccumulator();%0A%0A  /**%0A   * Adds the given input value to the given accumulator, returning the new accumulator value.%0A   *%0A   * @param mutableAccumulator may be modified and returned for efficiency%0A   * @param input should not be mutated%0A   */%0A  AccumT addInput(AccumT mutableAccumulator, InputT input);%0A%0A  /**%0A   * Returns an accumulator representing the accumulation of all the input values accumulated in the%0A   * merging accumulators.%0A   *%0A   * @param accumulators only the first accumulator may be modified and returned for efficiency; the%0A   *     other accumulators should not be mutated, because they may be shared with other code and%0A   *     mutating them could lead to incorrect results or data corruption.%0A   */%0A  AccumT mergeAccumulators(Iterable%3CAccumT%3E accumulators);%0A%0A  /**%0A   * Returns the output value that is the result of combining all the input values represented by%0A   * the given accumulator.%0A   *%0A   * @param accumulator can be modified for efficiency%0A   */%0A  OutputT extractOutput(AccumT accumulator);%0A%7D%0A

Add SQL AggregateFn interface.