Package io.trino.sql.planner.sanity
Class ValidateAggregationsWithDefaultValues
java.lang.Object
io.trino.sql.planner.sanity.ValidateAggregationsWithDefaultValues
- All Implemented Interfaces:
PlanSanityChecker.Checker
public class ValidateAggregationsWithDefaultValues
extends Object
implements PlanSanityChecker.Checker
When an aggregation has an empty grouping set then a default value needs to be returned in the output (e.g: 0 for COUNT(*)).
In case if the aggregation is split into FINAL and PARTIAL, then default values are produced by PARTIAL
aggregations. In order for the default values not to be duplicated, FINAL aggregation needs to be
separated from PARTIAL aggregation by a remote repartition exchange or the FINAL aggregation needs to be executed
on a single node. In case both FINAL and PARTIAL aggregations are executed on a single node, then those need to separated
by a local repartition exchange or the FINAL aggregation needs to be executed in a single thread.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvalidate(PlanNode planNode, Session session, PlannerContext plannerContext, TypeAnalyzer typeAnalyzer, TypeProvider types, WarningCollector warningCollector)
-
Constructor Details
-
ValidateAggregationsWithDefaultValues
public ValidateAggregationsWithDefaultValues(boolean forceSingleNode)
-
-
Method Details
-
validate
public void validate(PlanNode planNode, Session session, PlannerContext plannerContext, TypeAnalyzer typeAnalyzer, TypeProvider types, WarningCollector warningCollector) - Specified by:
validatein interfacePlanSanityChecker.Checker
-