morrySnow commented on code in PR #10659: URL: https://github.com/apache/doris/pull/10659#discussion_r915557011
########## fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java: ########## @@ -100,8 +103,25 @@ private static Expression swapEqualToForChildrenOrder(EqualTo<?, ?> equalTo, Lis } } - public void translatePlan(PhysicalPlan physicalPlan, PlanTranslatorContext context) { - visit(physicalPlan, context); + /** + * Translate Nereids Physical Plan tree to Stale Planner PlanFragment tree. + * + * @param physicalPlan Nereids Physical Plan tree + * @param context context to help translate + * @return Stale Planner PlanFragment tree + */ + public PlanFragment translatePlan(PhysicalPlan physicalPlan, PlanTranslatorContext context) { + PlanFragment rootFragment = visit(physicalPlan, context); + if (rootFragment.isPartitioned() && rootFragment.getPlanRoot().getNumInstances() > 1) { + rootFragment = createMergeFragment(rootFragment, context); + context.addPlanFragment(rootFragment); Review Comment: good way -- 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