924060929 commented on code in PR #12583: URL: https://github.com/apache/doris/pull/12583#discussion_r1019915205
########## fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java: ########## @@ -133,6 +140,26 @@ public PlanFragment translatePlan(PhysicalPlan physicalPlan, PlanTranslatorConte return rootFragment; } + private List<SlotReference> genGroupBySlotList(List<Expression> groupByExpressionList, + List<NamedExpression> outputExpressionList) { + List<SlotReference> groupSlotList = Lists.newArrayList(); + Set<VirtualSlotReference> virtualSlotReferences = groupByExpressionList.stream() + .filter(VirtualSlotReference.class::isInstance) + .map(VirtualSlotReference.class::cast) + .collect(Collectors.toSet()); + for (Expression e : groupByExpressionList) { + if (e instanceof SlotReference && outputExpressionList.stream().anyMatch(o -> o.anyMatch(e::equals))) { + groupSlotList.add((SlotReference) e); Review Comment: ```suggestion if (virtualSlotReferences.contains(e))) { groupSlotList.add((VirtualSlotReference) e); ``` ########## fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/ExpressionTranslator.java: ########## @@ -380,4 +409,12 @@ private static org.apache.doris.analysis.AssertNumRowsElement.Assertion translat throw new AnalysisException("UnSupported type: " + assertion); } } + + public static GroupByClause.GroupingType translateGroupingType( + PhysicalRepeat repeat) { + if (repeat instanceof PhysicalGroupingSets) { + return GroupingType.GROUPING_SETS; + } + throw new AnalysisException("UnSupported type"); + } Review Comment: PhysicalRepeat is a Plan, don't translate in ExpressionTranslator. You can move to PhysicalPlanTranslator. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org