You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/07/10 02:25:49 UTC

[doris] 02/02: [hotfix](dev-1.0.1) support convert between nullable and non-nullable in join node

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

morningman pushed a commit to branch dev-1.0.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 2cb493947f7c1baae0290f068687633818b35639
Author: morningman <mo...@apache.org>
AuthorDate: Sat Jul 9 22:17:35 2022 +0800

    [hotfix](dev-1.0.1) support convert between nullable and non-nullable in join node
    
    Authored by HappenLee #10721
---
 be/src/vec/exec/join/vhash_join_node.cpp | 6 +++++-
 be/src/vec/exec/vaggregation_node.cpp    | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/exec/join/vhash_join_node.cpp b/be/src/vec/exec/join/vhash_join_node.cpp
index 25be6c80a9..72af7c29b3 100644
--- a/be/src/vec/exec/join/vhash_join_node.cpp
+++ b/be/src/vec/exec/join/vhash_join_node.cpp
@@ -1368,10 +1368,14 @@ Status HashJoinNode::_build_output_block(Block* origin_block, Block* output_bloc
     // we should repalce `insert_column_datas` by `insert_range_from`
 
     auto insert_column_datas = [](auto& to, const auto& from, size_t rows) {
-        if (to->is_nullable() && !from.is_nullable()) {
+        auto [to_null, from_null] = std::pair {to->is_nullable(), from.is_nullable()};
+        if (to_null && !from_null) {
             auto& null_column = reinterpret_cast<ColumnNullable&>(*to);
             null_column.get_nested_column().insert_range_from(from, 0, rows);
             null_column.get_null_map_column().get_data().resize_fill(rows, 0);
+        } else if (!to_null && from_null) {
+            const auto& null_column = reinterpret_cast<const ColumnNullable&>(from);
+            to->insert_range_from(null_column.get_nested_column(), 0, rows);
         } else {
             to->insert_range_from(from, 0, rows);
         }
diff --git a/be/src/vec/exec/vaggregation_node.cpp b/be/src/vec/exec/vaggregation_node.cpp
index 4dd89499a1..2b09884575 100644
--- a/be/src/vec/exec/vaggregation_node.cpp
+++ b/be/src/vec/exec/vaggregation_node.cpp
@@ -77,7 +77,10 @@ static constexpr int STREAMING_HT_MIN_REDUCTION_SIZE =
 AggregationNode::AggregationNode(ObjectPool* pool, const TPlanNode& tnode,
                                  const DescriptorTbl& descs)
         : ExecNode(pool, tnode, descs),
-          _aggregate_evaluators_changed_flags(tnode.agg_node.aggregate_function_changed_flags),
+          _aggregate_evaluators_changed_flags(
+                  tnode.agg_node.__isset.aggregate_function_changed_flags
+                          ? tnode.agg_node.aggregate_function_changed_flags
+                          : std::vector<bool> {}),
           _intermediate_tuple_id(tnode.agg_node.intermediate_tuple_id),
           _intermediate_tuple_desc(NULL),
           _output_tuple_id(tnode.agg_node.output_tuple_id),


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org