Kikyou1997 commented on code in PR #13252:
URL: https://github.com/apache/doris/pull/13252#discussion_r998935447
##########
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:
Well, i think it doesn't matter, anyway, nereids is still under developing
we could remove it when it gets mature.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]