@Internal public class JsonObjectAggFunction extends BuiltInAggregateFunction<String,JsonObjectAggFunction.Accumulator>
BuiltInFunctionDefinitions.JSON_OBJECTAGG_NULL_ON_NULL
/ BuiltInFunctionDefinitions.JSON_OBJECTAGG_ABSENT_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 |
JsonObjectAggFunction.Accumulator
Accumulator for
JsonObjectAggFunction . |
Constructor and Description |
---|
JsonObjectAggFunction(LogicalType[] argumentTypes,
boolean skipNulls) |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(JsonObjectAggFunction.Accumulator acc,
StringData keyData,
StringData valueData) |
JsonObjectAggFunction.Accumulator |
createAccumulator()
Creates and initializes the accumulator for this
ImperativeAggregateFunction . |
DataType |
getAccumulatorDataType() |
List<DataType> |
getArgumentDataTypes() |
DataType |
getOutputDataType() |
String |
getValue(JsonObjectAggFunction.Accumulator acc)
Called every time when an aggregation result should be materialized.
|
void |
merge(JsonObjectAggFunction.Accumulator acc,
Iterable<JsonObjectAggFunction.Accumulator> others) |
void |
resetAccumulator(JsonObjectAggFunction.Accumulator acc) |
void |
retract(JsonObjectAggFunction.Accumulator acc,
StringData keyData,
StringData valueData) |
getRequirements, getTypeInference, isDeterministic
getKind
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
supportsConstantFolding
public JsonObjectAggFunction(LogicalType[] argumentTypes, boolean skipNulls)
public List<DataType> getArgumentDataTypes()
getArgumentDataTypes
in class BuiltInAggregateFunction<String,JsonObjectAggFunction.Accumulator>
public DataType getOutputDataType()
getOutputDataType
in class BuiltInAggregateFunction<String,JsonObjectAggFunction.Accumulator>
public DataType getAccumulatorDataType()
getAccumulatorDataType
in class BuiltInAggregateFunction<String,JsonObjectAggFunction.Accumulator>
public JsonObjectAggFunction.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,JsonObjectAggFunction.Accumulator>
public void resetAccumulator(JsonObjectAggFunction.Accumulator acc)
public void accumulate(JsonObjectAggFunction.Accumulator acc, StringData keyData, @Nullable StringData valueData) throws Exception
Exception
public void retract(JsonObjectAggFunction.Accumulator acc, StringData keyData, @Nullable StringData valueData) throws Exception
Exception
public void merge(JsonObjectAggFunction.Accumulator acc, Iterable<JsonObjectAggFunction.Accumulator> others) throws Exception
Exception
public String getValue(JsonObjectAggFunction.Accumulator acc)
AggregateFunction
getValue
in class AggregateFunction<String,JsonObjectAggFunction.Accumulator>
acc
- the accumulator which contains the current intermediate resultsCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.