[feature](Nereids) support select distinct with aggregate (#35300)
(cherry picked from commit adcbc8cce57aaec507174f39536a028db803a2e5)
This commit is contained in:
@ -2904,10 +2904,6 @@ public class LogicalPlanBuilder extends DorisParserBaseVisitor<Object> {
|
||||
SelectColumnClauseContext selectColumnCtx = selectClause.selectColumnClause();
|
||||
LogicalPlan aggregate = withAggregate(filter, selectColumnCtx, aggClause);
|
||||
boolean isDistinct = (selectClause.DISTINCT() != null);
|
||||
if (isDistinct && aggregate instanceof Aggregate) {
|
||||
throw new ParseException("cannot combine SELECT DISTINCT with aggregate functions or GROUP BY",
|
||||
selectClause);
|
||||
}
|
||||
if (!(aggregate instanceof Aggregate) && havingClause.isPresent()) {
|
||||
// create a project node for pattern match of ProjectToGlobalAggregate rule
|
||||
// then ProjectToGlobalAggregate rule can insert agg node as LogicalHaving node's child
|
||||
|
||||
Reference in New Issue
Block a user