You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2023/01/09 11:09:56 UTC

[GitHub] [doris] englefly commented on a diff in pull request #15646: [fix](nereids) bind sort key priority problem

englefly commented on code in PR #15646:
URL: https://github.com/apache/doris/pull/15646#discussion_r1064521948


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSlotReference.java:
##########
@@ -354,13 +355,32 @@ public List<Rule> buildRules() {
             RuleType.BINDING_SORT_SLOT.build(
                 logicalSort(logicalProject()).when(Plan::canBind).thenApply(ctx -> {
                     LogicalSort<LogicalProject<GroupPlan>> sort = ctx.root;
+                    Set<Slot> orderSlots = Sets.newHashSet();
+                    sort.getOrderKeys().stream()
+                            .forEach(orderKey ->
+                                orderSlots.addAll(orderKey.getExpr().getInputSlots()));
+                    Set<Slot> projectOutput = sort.child().getOutputSet();
+                    SlotBinder strictBinderOnProject = new SlotBinder(toScope(Lists.newArrayList(projectOutput)),
+                            sort, true, ctx.cascadesContext);
+                    //SlotBinder looseBinderOnProject = new SlotBinder(toScope(Lists.newArrayList(projectOutput)),
+                    //        sort, false, ctx.cascadesContext);

Review Comment:
   done



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSlotReference.java:
##########
@@ -540,10 +560,17 @@ private <E extends Expression> E bind(E expr, List<Plan> inputs, Plan plan, Casc
 
     private class SlotBinder extends SubExprAnalyzer {
         private final Plan plan;
+        //strict = true: bind slot including its qualifier
+        private boolean strict;

Review Comment:
   done



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org