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/07 09:59:30 UTC

[GitHub] [doris] zhengshiJ opened a new pull request, #10678: print explain

zhengshiJ opened a new pull request, #10678:
URL: https://github.com/apache/doris/pull/10678

   # Proposed changes
   
   Physical sort:
        * 1. Build sortInfo
        *    There are two types of slotRef:
        *    one is generated by the previous node, collectively called old.
        *    the other is newly generated by the sort node, collectively called new.
        *    Filling of sortInfo related data structures,
        *    a. ordering use newSlotRef.
        *    b. sortTupleSlotExprs use oldSlotRef.
        * 2. Create sortNode
        * 3. Create mergeFragment
   
   ## Problem Summary:
   
   Describe the overview of changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (No)
   2. Has unit tests been added: (No)
   3. Has document been added or modified: (No Need)
   4. Does it need to update dependencies: (No)
   5. Are there any changes that cannot be rolled back: (No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
zhengshiJ commented on code in PR #10678:
URL: https://github.com/apache/doris/pull/10678#discussion_r916452432


##########
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:
   done



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


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

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 commented on code in PR #10678:
URL: https://github.com/apache/doris/pull/10678#discussion_r916462128


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java:
##########
@@ -117,6 +119,24 @@ public void setMaterializedTupleInfo(
         }
     }
 
+    /**
+     * Sets tupleInfo.
+     * Just for Nereids.
+     */
+    public void setTupleInfo(

Review Comment:
   Wraps up as an implementation of the expr like ```finalizeImplForNereids``` function, and annotated only for the nereids optimizer translator.



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


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

Posted by GitBox <gi...@apache.org>.
zhengshiJ commented on code in PR #10678:
URL: https://github.com/apache/doris/pull/10678#discussion_r916452278


##########
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:
   No, the ones that have already been generated will be deduplicated, So only a,b,c will be generated



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


[GitHub] [doris] EmmyMiao87 merged pull request #10678: [feature](nereides) support sort translator

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 merged PR #10678:
URL: https://github.com/apache/doris/pull/10678


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


[GitHub] [doris] github-actions[bot] commented on pull request #10678: [feature](nereides) support sort translator

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10678:
URL: https://github.com/apache/doris/pull/10678#issuecomment-1178821541

   PR approved by at least one committer and no changes requested.


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


[GitHub] [doris] github-actions[bot] commented on pull request #10678: [feature](nereides) support sort translator

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10678:
URL: https://github.com/apache/doris/pull/10678#issuecomment-1178821588

   PR approved by anyone and no changes requested.


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


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

Posted by GitBox <gi...@apache.org>.
zhengshiJ commented on code in PR #10678:
URL: https://github.com/apache/doris/pull/10678#discussion_r916543059


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java:
##########
@@ -117,6 +119,24 @@ public void setMaterializedTupleInfo(
         }
     }
 
+    /**
+     * Sets tupleInfo.
+     * Just for Nereids.
+     */
+    public void setTupleInfo(

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