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 2022/07/08 02:08:23 UTC

[GitHub] [doris] morrySnow commented on a diff in pull request #10678: [feature](nereides) support sort translator

morrySnow commented on code in PR #10678:
URL: https://github.com/apache/doris/pull/10678#discussion_r915824951


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java:
##########
@@ -63,6 +63,7 @@ public class SortInfo {
     // sortTupleDesc_.
     private List<Expr> sortTupleSlotExprs;
 
+

Review Comment:
   useless blank line



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -362,6 +403,19 @@ private TupleDescriptor generateTupleDesc(List<Slot> slotList, PlanTranslatorCon
         return tupleDescriptor;
     }
 
+    private TupleDescriptor generateTupleDesc(List<Slot> slotList, List<OrderKey> orderKeyList,

Review Comment:
   if we plan a query 'select a,b,c from t order by a'. will this generate a tuple like 'a, a, b, c'? 



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -255,7 +279,24 @@ public PlanFragment visitPhysicalSort(PhysicalUnaryPlan<PhysicalHeapSort, Plan>
         return mergeFragment;
     }
 
-    // TODO: 1. support shuffle join / co-locate / bucket shuffle join later
+    /**
+     * Populate the SortTupleSlotExprs member.
+     */
+    private void createSortTupleSlotExprs(SortInfo info,
+            TupleDescriptor tupleDescriptor,
+            List<Expr> outputList, List<Expr> orderingExpr) {
+        List<Expr> sortTupleSlotExprs = new ArrayList<>();
+        Set<ExprId> exprIds = new HashSet<>();
+        outputList.addAll(orderingExpr);
+        for (Expr expr : outputList) {
+            if (!exprIds.contains(expr)) {

Review Comment:
   exprIds never update. and use ExprId compare with Expr



-- 
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