Class WrapJsonAggFunctionArgumentsRule
- java.lang.Object
-
- org.apache.calcite.plan.RelOptRule
-
- org.apache.calcite.plan.RelRule<WrapJsonAggFunctionArgumentsRule.Config>
-
- org.apache.flink.table.planner.plan.rules.logical.WrapJsonAggFunctionArgumentsRule
-
@Internal @Enclosing public class WrapJsonAggFunctionArgumentsRule extends org.apache.calcite.plan.RelRule<WrapJsonAggFunctionArgumentsRule.Config>
Transforms JSON aggregation functions by wrapping operands intoBuiltInFunctionDefinitions.JSON_STRING
.Essentially, a call like
JSON_OBJECTAGG(f0 VALUE f1)
will be transformed intoJSON_OBJECTAGG(f0 VALUE JSON_STRING(f1))
. By placing a markerRelHint
on the aggregation afterwards we ensure that this transformation occurs just once.BuiltInFunctionDefinitions.JSON_STRING
will take care of serializing the values into their correct representation, and the actual aggregation function's implementation can simply insert the values as raw nodes instead. This avoids having to re-implement the logic for all supported types in the aggregation function again.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
WrapJsonAggFunctionArgumentsRule.Config
Configuration forWrapJsonAggFunctionArgumentsRule
.-
Nested classes/interfaces inherited from class org.apache.calcite.plan.RelRule
org.apache.calcite.plan.RelRule.Done, org.apache.calcite.plan.RelRule.MatchHandler<R extends org.apache.calcite.plan.RelOptRule>, org.apache.calcite.plan.RelRule.OperandBuilder, org.apache.calcite.plan.RelRule.OperandDetailBuilder<R extends org.apache.calcite.rel.RelNode>, org.apache.calcite.plan.RelRule.OperandTransform
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.calcite.plan.RelOptRule
INSTANCE
-
Constructor Summary
Constructors Constructor Description WrapJsonAggFunctionArgumentsRule(WrapJsonAggFunctionArgumentsRule.Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onMatch(org.apache.calcite.plan.RelOptRuleCall call)
-
Methods inherited from class org.apache.calcite.plan.RelOptRule
any, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
-
-
-
-
Constructor Detail
-
WrapJsonAggFunctionArgumentsRule
public WrapJsonAggFunctionArgumentsRule(WrapJsonAggFunctionArgumentsRule.Config config)
-
-