public class Aggregators
extends java.lang.Object
Constructor and Description |
---|
Aggregators() |
Modifier and Type | Method and Description |
---|---|
static <ValT,AccT,ResT,InT> |
value(Combine.CombineFn<ValT,AccT,ResT> fn,
ScalaInterop.Fun1<InT,ValT> valueFn,
org.apache.spark.sql.Encoder<AccT> accEnc,
org.apache.spark.sql.Encoder<ResT> outEnc)
Creates simple value
Aggregator that is not window aware. |
static <ValT,AccT,ResT,InT> |
windowedValue(Combine.CombineFn<ValT,AccT,ResT> fn,
ScalaInterop.Fun1<org.apache.beam.sdk.util.WindowedValue<InT>,ValT> valueFn,
WindowingStrategy<?,?> windowing,
org.apache.spark.sql.Encoder<BoundedWindow> windowEnc,
org.apache.spark.sql.Encoder<AccT> accEnc,
org.apache.spark.sql.Encoder<org.apache.beam.sdk.util.WindowedValue<ResT>> outEnc)
Creates windowed Spark
Aggregator depending on the provided Beam WindowFn s. |
public static <ValT,AccT,ResT,InT> org.apache.spark.sql.expressions.Aggregator<InT,?,ResT> value(Combine.CombineFn<ValT,AccT,ResT> fn, ScalaInterop.Fun1<InT,ValT> valueFn, org.apache.spark.sql.Encoder<AccT> accEnc, org.apache.spark.sql.Encoder<ResT> outEnc)
Aggregator
that is not window aware.ValT
- Combine.CombineFn
input typeAccT
- Combine.CombineFn
accumulator typeResT
- Combine.CombineFn
/ Aggregator
result typeInT
- Aggregator
input typepublic static <ValT,AccT,ResT,InT> org.apache.spark.sql.expressions.Aggregator<org.apache.beam.sdk.util.WindowedValue<InT>,?,java.util.Collection<org.apache.beam.sdk.util.WindowedValue<ResT>>> windowedValue(Combine.CombineFn<ValT,AccT,ResT> fn, ScalaInterop.Fun1<org.apache.beam.sdk.util.WindowedValue<InT>,ValT> valueFn, WindowingStrategy<?,?> windowing, org.apache.spark.sql.Encoder<BoundedWindow> windowEnc, org.apache.spark.sql.Encoder<AccT> accEnc, org.apache.spark.sql.Encoder<org.apache.beam.sdk.util.WindowedValue<ResT>> outEnc)
Aggregator
depending on the provided Beam WindowFn
s.
Specialised implementations are provided for:
Sessions
ValT
- Combine.CombineFn
input typeAccT
- Combine.CombineFn
accumulator typeResT
- Combine.CombineFn
/ Aggregator
result typeInT
- Aggregator
input type