jackwener commented on code in PR #13252: URL: https://github.com/apache/doris/pull/13252#discussion_r998913714
########## fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java: ########## @@ -190,25 +190,31 @@ public Group getRoot() { private PhysicalPlan chooseBestPlan(Group rootGroup, PhysicalProperties physicalProperties) throws AnalysisException { - GroupExpression groupExpression = rootGroup.getLowestCostPlan(physicalProperties).orElseThrow( - () -> new AnalysisException("lowestCostPlans with physicalProperties doesn't exist")).second; - List<PhysicalProperties> inputPropertiesList = groupExpression.getInputPropertiesList(physicalProperties); - - List<Plan> planChildren = Lists.newArrayList(); - for (int i = 0; i < groupExpression.arity(); i++) { - planChildren.add(chooseBestPlan(groupExpression.child(i), inputPropertiesList.get(i))); - } - - Plan plan = groupExpression.getPlan().withChildren(planChildren); - if (!(plan instanceof PhysicalPlan)) { - throw new AnalysisException("Result plan must be PhysicalPlan"); + try { + GroupExpression groupExpression = rootGroup.getLowestCostPlan(physicalProperties).orElseThrow( + () -> new AnalysisException("lowestCostPlans with physicalProperties doesn't exist")).second; + List<PhysicalProperties> inputPropertiesList = groupExpression.getInputPropertiesList(physicalProperties); + + List<Plan> planChildren = Lists.newArrayList(); + for (int i = 0; i < groupExpression.arity(); i++) { + planChildren.add(chooseBestPlan(groupExpression.child(i), inputPropertiesList.get(i))); + } + + Plan plan = groupExpression.getPlan().withChildren(planChildren); + if (!(plan instanceof PhysicalPlan)) { + throw new AnalysisException("Result plan must be PhysicalPlan"); + } + + // TODO: set (logical and physical)properties/statistics/... for physicalPlan. + PhysicalPlan physicalPlan = ((PhysicalPlan) plan).withPhysicalPropertiesAndStats( + groupExpression.getOutputProperties(physicalProperties), + groupExpression.getOwnerGroup().getStatistics()); + return physicalPlan; + } catch (Exception e) { + String memo = cascadesContext.getMemo().toString(); Review Comment: Memo can be very large, I think print it isn't a good choice -- 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