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/09/19 11:06:01 UTC

[GitHub] [doris] morrySnow opened a new pull request, #12743: Use set as output

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

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [ ] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   3. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [ ] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [ ] 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] englefly commented on a diff in pull request #12743: [enhancement](Nereids) compare LogicalProperties with output set instead of output list

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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -579,54 +578,59 @@ public PlanFragment visitPhysicalHashJoin(
                 .map(SlotReference.class::cast)
                 .forEach(s -> hashOutputSlotReferenceMap.put(s.getExprId(), s));
 
+        Map<ExprId, SlotReference> leftChildOutputMap = Maps.newHashMap();
+        hashJoin.child(0).getOutput().stream()
+                .map(SlotReference.class::cast)
+                .forEach(s -> leftChildOutputMap.put(s.getExprId(), s));
+        Map<ExprId, SlotReference> rightChildOutputMap = Maps.newHashMap();
+        hashJoin.child(1).getOutput().stream()
+                .map(SlotReference.class::cast)
+                .forEach(s -> rightChildOutputMap.put(s.getExprId(), s));
+
         //make intermediate tuple
         List<SlotDescriptor> leftIntermediateSlotDescriptor = Lists.newArrayList();
         List<SlotDescriptor> rightIntermediateSlotDescriptor = Lists.newArrayList();
         TupleDescriptor intermediateDescriptor = context.generateTupleDesc();
 
         if (!hashJoin.getOtherJoinCondition().isPresent()
                 && (joinType == JoinType.LEFT_ANTI_JOIN || joinType == JoinType.LEFT_SEMI_JOIN)) {
-            leftIntermediateSlotDescriptor = hashJoin.child(0).getOutput().stream()
-                    .map(SlotReference.class::cast)
-                    .map(s -> context.createSlotDesc(intermediateDescriptor, s))
-                    .collect(Collectors.toList());
+            for (SlotDescriptor leftSlotDescriptor : leftSlotDescriptors) {
+                SlotReference sf = leftChildOutputMap.get(context.findExprId(leftSlotDescriptor.getId()));

Review Comment:
   `sf` could be null. It is better to add a if-else to catch it.
   Without `if (sf == null)`, it is hard for debug, because we do not print stack trace when we catch NPE exception.



-- 
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 #12743: [enhancement](Nereids) compare LogicalProperties with output set instead of output list

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

   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] morrySnow merged pull request #12743: [enhancement](Nereids) compare LogicalProperties with output set instead of output list

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


-- 
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 #12743: [enhancement](Nereids) compare LogicalProperties with output set instead of output list

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

   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] morrySnow commented on a diff in pull request #12743: [enhancement](Nereids) compare LogicalProperties with output set instead of output list

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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -579,54 +578,59 @@ public PlanFragment visitPhysicalHashJoin(
                 .map(SlotReference.class::cast)
                 .forEach(s -> hashOutputSlotReferenceMap.put(s.getExprId(), s));
 
+        Map<ExprId, SlotReference> leftChildOutputMap = Maps.newHashMap();
+        hashJoin.child(0).getOutput().stream()
+                .map(SlotReference.class::cast)
+                .forEach(s -> leftChildOutputMap.put(s.getExprId(), s));
+        Map<ExprId, SlotReference> rightChildOutputMap = Maps.newHashMap();
+        hashJoin.child(1).getOutput().stream()
+                .map(SlotReference.class::cast)
+                .forEach(s -> rightChildOutputMap.put(s.getExprId(), s));
+
         //make intermediate tuple
         List<SlotDescriptor> leftIntermediateSlotDescriptor = Lists.newArrayList();
         List<SlotDescriptor> rightIntermediateSlotDescriptor = Lists.newArrayList();
         TupleDescriptor intermediateDescriptor = context.generateTupleDesc();
 
         if (!hashJoin.getOtherJoinCondition().isPresent()
                 && (joinType == JoinType.LEFT_ANTI_JOIN || joinType == JoinType.LEFT_SEMI_JOIN)) {
-            leftIntermediateSlotDescriptor = hashJoin.child(0).getOutput().stream()
-                    .map(SlotReference.class::cast)
-                    .map(s -> context.createSlotDesc(intermediateDescriptor, s))
-                    .collect(Collectors.toList());
+            for (SlotDescriptor leftSlotDescriptor : leftSlotDescriptors) {
+                SlotReference sf = leftChildOutputMap.get(context.findExprId(leftSlotDescriptor.getId()));

Review Comment:
   this PR is block other job, need fast merge, fix it in next PR



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