@Internal public class JsonArrayAggFunction extends BuiltInAggregateFunction<String,JsonArrayAggFunction.Accumulator>
BuiltInFunctionDefinitions.JSON_ARRAYAGG_ABSENT_ON_NULL
/ BuiltInFunctionDefinitions.JSON_ARRAYAGG_NULL_ON_NULL
.
Note that this function only ever receives strings to accumulate because WrapJsonAggFunctionArgumentsRule
wraps arguments into BuiltInFunctionDefinitions.JSON_STRING
.
Modifier and Type | Class and Description |
---|---|
static class |
JsonArrayAggFunction.Accumulator
Accumulator for
JsonArrayAggFunction . |
Constructor and Description |
---|
JsonArrayAggFunction(LogicalType[] argumentTypes,
boolean skipNulls) |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(JsonArrayAggFunction.Accumulator acc,
StringData itemData) |
JsonArrayAggFunction.Accumulator |
createAccumulator()
Creates and initializes the accumulator for this
ImperativeAggregateFunction . |
DataType |
getAccumulatorDataType() |
List<DataType> |
getArgumentDataTypes() |
DataType |
getOutputDataType() |
String |
getValue(JsonArrayAggFunction.Accumulator acc)
Called every time when an aggregation result should be materialized.
|
void |
resetAccumulator(JsonArrayAggFunction.Accumulator acc) |
void |
retract(JsonArrayAggFunction.Accumulator acc,
StringData itemData) |
getRequirements, getTypeInference, isDeterministic
getKind
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
supportsConstantFolding
public JsonArrayAggFunction(LogicalType[] argumentTypes, boolean skipNulls)
public List<DataType> getArgumentDataTypes()
getArgumentDataTypes
in class BuiltInAggregateFunction<String,JsonArrayAggFunction.Accumulator>
public DataType getOutputDataType()
getOutputDataType
in class BuiltInAggregateFunction<String,JsonArrayAggFunction.Accumulator>
public DataType getAccumulatorDataType()
getAccumulatorDataType
in class BuiltInAggregateFunction<String,JsonArrayAggFunction.Accumulator>
public JsonArrayAggFunction.Accumulator createAccumulator()
ImperativeAggregateFunction
ImperativeAggregateFunction
.
The accumulator is an intermediate data structure that stores the aggregated values until a final aggregation result is computed.
createAccumulator
in class ImperativeAggregateFunction<String,JsonArrayAggFunction.Accumulator>
public void resetAccumulator(JsonArrayAggFunction.Accumulator acc)
public void accumulate(JsonArrayAggFunction.Accumulator acc, StringData itemData) throws Exception
Exception
public void retract(JsonArrayAggFunction.Accumulator acc, StringData itemData) throws Exception
Exception
public String getValue(JsonArrayAggFunction.Accumulator acc)
AggregateFunction
getValue
in class AggregateFunction<String,JsonArrayAggFunction.Accumulator>
acc
- the accumulator which contains the current intermediate resultsCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.