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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AdjustNullable.java:
##########
@@ -289,25 +291,61 @@ public Plan visitLogicalSetOperation(LogicalSetOperation 
setOperation, Map<ExprI
         ImmutableList.Builder<List<SlotReference>> newChildrenOutputs = 
ImmutableList.builder();
         List<Boolean> inputNullable = null;
         if (!setOperation.children().isEmpty()) {
-            inputNullable = 
Lists.newArrayListWithCapacity(setOperation.getOutputs().size());
-            for (int i = 0; i < setOperation.getOutputs().size(); i++) {
-                inputNullable.add(false);
+            // whether the output column can be null depends on the semantics 
of the set operation:
+            // - union: a row is in the result if it appears in any child, so 
the column can be null if any
+            //   child column can be null;
+            // - intersect: a row is in the result only if it appears in every 
child, so the column can be
+            //   null only if every child column can be null;
+            // - except: the result is a subset of the left child(child(0)), 
so the column can be null only

Review Comment:
   但是 LogicalSetOperation里面不是这么计算的,所以这里真的应该这么改吗?另外,这个逻辑和BE是对齐的吗?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to