This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new d4cc1052c6a [cherry-pick][bug] fix intersect node nullable field 
should depend on row_descriptor(#26038) (#26273)
d4cc1052c6a is described below

commit d4cc1052c6af21f654094e28065957cef06340b6
Author: zhangstar333 <[email protected]>
AuthorDate: Thu Nov 2 17:58:38 2023 +0800

    [cherry-pick][bug] fix intersect node nullable field should depend on 
row_descriptor(#26038) (#26273)
---
 be/src/vec/exec/vset_operation_node.cpp | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/be/src/vec/exec/vset_operation_node.cpp 
b/be/src/vec/exec/vset_operation_node.cpp
index 9196d40668b..fb4b8bed48d 100644
--- a/be/src/vec/exec/vset_operation_node.cpp
+++ b/be/src/vec/exec/vset_operation_node.cpp
@@ -47,6 +47,7 @@
 #include "vec/exprs/vexpr.h"
 #include "vec/exprs/vexpr_context.h"
 #include "vec/utils/template_helpers.hpp"
+#include "vec/utils/util.hpp"
 
 namespace doris {
 class DescriptorTbl;
@@ -268,14 +269,18 @@ Status 
VSetOperationNode<is_intersect>::prepare(RuntimeState* state) {
     _build_timer = ADD_TIMER(runtime_profile(), "BuildTime");
     _probe_timer = ADD_TIMER(runtime_profile(), "ProbeTime");
     _pull_timer = ADD_TIMER(runtime_profile(), "PullTime");
+    auto output_data_types = VectorizedUtils::get_data_types(_row_descriptor);
+    auto column_nums = _child_expr_lists[0].size();
+    DCHECK_EQ(output_data_types.size(), column_nums)
+            << output_data_types.size() << " " << column_nums;
+    // the nullable is not depend on child, it's should use _row_descriptor 
from FE plan
+    // some case all not nullable column from children, but maybe need output 
nullable.
+    vector<bool> nullable_flags(column_nums, false);
+    for (int i = 0; i < column_nums; ++i) {
+        nullable_flags[i] = output_data_types[i]->is_nullable();
+    }
 
-    // Prepare result expr lists.
-    vector<bool> nullable_flags;
-    nullable_flags.resize(_child_expr_lists[0].size(), false);
     for (int i = 0; i < _child_expr_lists.size(); ++i) {
-        for (int j = 0; j < _child_expr_lists[i].size(); ++j) {
-            nullable_flags[j] = nullable_flags[j] || 
_child_expr_lists[i][j]->root()->is_nullable();
-        }
         RETURN_IF_ERROR(VExpr::prepare(_child_expr_lists[i], state, 
child(i)->row_desc()));
     }
     for (int i = 0; i < _child_expr_lists[0].size(); ++i) {


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

Reply via email to