github-actions[bot] commented on code in PR #62803:
URL: https://github.com/apache/doris/pull/62803#discussion_r3144574553


##########
be/test/exec/operator/nested_loop_join_probe_operator_test.cpp:
##########
@@ -0,0 +1,357 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "exec/operator/nested_loop_join_probe_operator.h"
+
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <gen_cpp/Types_types.h>
+#include <gtest/gtest.h>
+
+#include <cstddef>
+#include <cstdint>
+#include <memory>
+#include <vector>
+
+#include "core/assert_cast.h"
+#include "core/block/block.h"
+#include "core/column/column_nullable.h"
+#include "core/column/column_vector.h"
+#include "core/data_type/data_type_nullable.h"
+#include "core/data_type/data_type_number.h"
+#include "exec/operator/nested_loop_join_build_operator.h"
+#include "exec/operator/operator.h"
+#include "exec/pipeline/dependency.h"
+#include "runtime/descriptor_helper.h"
+#include "testutil/column_helper.h"
+#include "testutil/creators.h"
+#include "testutil/mock/mock_operators.h"
+#include "testutil/mock/mock_runtime_state.h"
+
+namespace doris {
+
+class NLJProbeOperatorTest : public testing::Test {
+public:
+    void SetUp() override {
+        _runtime_state = std::make_unique<MockRuntimeState>();
+        _obj_pool = std::make_unique<ObjectPool>();
+        _runtime_profile = std::make_shared<RuntimeProfile>("test");
+        _query_ctx = generate_one_query();
+        _runtime_state->_query_ctx = _query_ctx.get();
+        _runtime_state->_query_id = _query_ctx->query_id();
+        _runtime_state->resize_op_id_to_local_state(-100);
+        _runtime_state->set_max_operator_id(-100);
+        ADD_TIMER(_runtime_profile.get(), "ExecTime");
+        _runtime_profile->AddHighWaterMarkCounter("MemoryUsed", TUnit::BYTES, 
"", 0);
+    }
+
+    void TearDown() override {}
+
+    // Build TPlanNode for NLJ with given join_op and is_mark.
+    // probe side: 1 INT column (non-nullable)
+    // build side: 1 INT column (non-nullable)
+    // For RIGHT_OUTER_JOIN, probe columns become nullable in 
intermediate/output.
+    TPlanNode create_nlj_plan_node(TJoinOp::type join_op, bool is_mark) {
+        TPlanNode tnode;
+        tnode.node_id = 0;
+        tnode.node_type = TPlanNodeType::CROSS_JOIN_NODE;
+        tnode.num_children = 2;
+        tnode.limit = -1;
+
+        TNestedLoopJoinNode nlj_node;
+        nlj_node.join_op = join_op;
+        nlj_node.__set_is_mark(is_mark);
+        tnode.__set_nested_loop_join_node(nlj_node);
+
+        // Build descriptor table:
+        //   tuple 0 = probe side (1 non-nullable INT slot)
+        //   tuple 1 = build side (1 non-nullable INT slot)
+        //   tuple 2 = intermediate (probe col nullable + build col nullable + 
mark col)
+        //   tuple 3 = output (same as intermediate)
+        TDescriptorTableBuilder builder;
+
+        // Probe side tuple (tuple 0)
+        TTupleDescriptorBuilder probe_tuple;
+        auto probe_slot = TSlotDescriptorBuilder()
+                                  .type(TYPE_INT)
+                                  .nullable(false)
+                                  .column_name("probe_col")
+                                  .build();
+        probe_slot.col_unique_id = 0;
+        probe_tuple.add_slot(probe_slot);
+        probe_tuple.build(&builder);
+
+        // Build side tuple (tuple 1)
+        TTupleDescriptorBuilder build_tuple;
+        auto build_slot = TSlotDescriptorBuilder()
+                                  .type(TYPE_INT)
+                                  .nullable(false)
+                                  .column_name("build_col")
+                                  .build();
+        build_slot.col_unique_id = 1;
+        build_tuple.add_slot(build_slot);
+        build_tuple.build(&builder);
+
+        // Intermediate tuple (tuple 2): probe col (nullable) + build col 
(nullable) + mark col
+        TTupleDescriptorBuilder intermediate_tuple;
+        auto inter_probe_slot = TSlotDescriptorBuilder()
+                                        .type(TYPE_INT)
+                                        .nullable(true)
+                                        .column_name("probe_col")
+                                        .build();
+        inter_probe_slot.col_unique_id = 10;
+        intermediate_tuple.add_slot(inter_probe_slot);
+
+        auto inter_build_slot = TSlotDescriptorBuilder()
+                                        .type(TYPE_INT)
+                                        .nullable(true)
+                                        .column_name("build_col")
+                                        .build();
+        inter_build_slot.col_unique_id = 11;
+        intermediate_tuple.add_slot(inter_build_slot);
+
+        if (is_mark) {
+            auto mark_slot = TSlotDescriptorBuilder()
+                                     .type(TYPE_BOOLEAN)
+                                     .nullable(true)
+                                     .column_name("mark")
+                                     .build();
+            mark_slot.col_unique_id = 12;
+            intermediate_tuple.add_slot(mark_slot);
+        }
+        intermediate_tuple.build(&builder);
+
+        // Output tuple (tuple 3): same layout as intermediate
+        TTupleDescriptorBuilder output_tuple;
+        auto out_probe_slot = TSlotDescriptorBuilder()
+                                      .type(TYPE_INT)
+                                      .nullable(true)
+                                      .column_name("probe_col")
+                                      .build();
+        out_probe_slot.col_unique_id = 20;
+        output_tuple.add_slot(out_probe_slot);
+
+        auto out_build_slot = TSlotDescriptorBuilder()
+                                      .type(TYPE_INT)
+                                      .nullable(true)
+                                      .column_name("build_col")
+                                      .build();
+        out_build_slot.col_unique_id = 21;
+        output_tuple.add_slot(out_build_slot);
+
+        if (is_mark) {
+            auto out_mark_slot = TSlotDescriptorBuilder()
+                                         .type(TYPE_BOOLEAN)
+                                         .nullable(true)
+                                         .column_name("mark")
+                                         .build();
+            out_mark_slot.col_unique_id = 22;
+            output_tuple.add_slot(out_mark_slot);
+        }
+        output_tuple.build(&builder);
+
+        tnode.row_tuples.push_back(0);
+        tnode.row_tuples.push_back(1);
+
+        nlj_node.vintermediate_tuple_id_list.push_back(2);
+        nlj_node.__isset.vintermediate_tuple_id_list = true;
+        tnode.__set_nested_loop_join_node(nlj_node);
+        tnode.__set_output_tuple_id(3);
+
+        // Build projection exprs: slot refs from intermediate to output
+        auto desc_table = builder.desc_tbl();
+        auto st = DescriptorTbl::create(_obj_pool.get(), desc_table, 
&_desc_tbl);
+        DCHECK(st.ok());
+        _runtime_state->set_desc_tbl(_desc_tbl);
+
+        // Projections: one SlotRef per output slot
+        std::vector<TExpr> projections;
+        for (auto& slot : desc_table.slotDescriptors) {
+            if (slot.parent == 2) { // intermediate tuple
+                TExpr expr;
+                TExprNode node;
+                node.node_type = TExprNodeType::SLOT_REF;
+                node.__set_is_nullable(slot.nullIndicatorByte >= 0);
+                node.num_children = 0;
+                node.__isset.slot_ref = true;
+                node.slot_ref.slot_id = slot.id;
+                node.slot_ref.col_unique_id = slot.col_unique_id;
+                node.slot_ref.__isset.col_unique_id = true;
+                node.type = slot.slotType;
+                expr.nodes.push_back(node);
+                projections.push_back(expr);
+            }
+        }
+        tnode.projections = projections;
+        tnode.__isset.projections = true;
+
+        return tnode;
+    }
+
+protected:
+    std::unique_ptr<MockRuntimeState> _runtime_state;
+    std::unique_ptr<ObjectPool> _obj_pool;
+    std::shared_ptr<QueryContext> _query_ctx;
+    std::shared_ptr<RuntimeProfile> _runtime_profile;
+    DescriptorTbl* _desc_tbl = nullptr;
+};
+
+// Exercises _append_probe_data_with_null through the full NLJ operator 
pipeline.
+// Trigger: RIGHT_OUTER_JOIN + mark join + empty build side + multi-row probe.
+// Before the fix, the null map was only extended by 1 instead of N, causing 
OOB.
+TEST_F(NLJProbeOperatorTest, AppendProbeDataWithNullMultiRow) {
+    auto tnode = create_nlj_plan_node(TJoinOp::RIGHT_OUTER_JOIN, true);
+
+    auto probe_operator =
+            std::make_shared<NestedLoopJoinProbeOperatorX>(_obj_pool.get(), 
tnode, 0, *_desc_tbl);
+    auto sink_operator = 
std::make_shared<NestedLoopJoinBuildSinkOperatorX>(_obj_pool.get(), 0, 0,
+                                                                            
tnode, *_desc_tbl);
+
+    // Wire up child operators
+    auto probe_source = std::make_shared<MockSourceOperator>();
+    auto build_source = std::make_shared<MockSourceOperator>();
+    auto probe_side_sink = std::make_shared<MockSinkOperator>();
+
+    RowDescriptor probe_row_desc(*_desc_tbl, {0});
+    probe_source->_row_descriptor = probe_row_desc;
+
+    RowDescriptor build_row_desc(*_desc_tbl, {1});
+    build_source->_row_descriptor = build_row_desc;
+
+    ASSERT_TRUE(sink_operator->set_child(build_source));
+    ASSERT_TRUE(probe_operator->set_child(probe_source));
+    ASSERT_TRUE(probe_operator->set_child(build_source));
+
+    // Create pipeline for PipelineTask
+    std::map<int,
+             std::pair<std::shared_ptr<BasicSharedState>, 
std::vector<std::shared_ptr<Dependency>>>>
+            shared_state_map;
+    auto [source_pipeline, _] =
+            generate_sort_pipeline(probe_operator, probe_side_sink, 
sink_operator, build_source);
+    auto pipeline_task = std::make_shared<PipelineTask>(source_pipeline, 0, 
_runtime_state.get(),

Review Comment:
   `doris_be_test` is compiled with `-Werror`, and this local is never read. As 
written, the new UT fails on `-Wunused-variable`. Please either keep the task 
on the fixture (like the existing join-test helpers do) or mark it 
intentionally unused if you only need the constructor side effects.



##########
be/test/exec/operator/nested_loop_join_probe_operator_test.cpp:
##########
@@ -0,0 +1,357 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "exec/operator/nested_loop_join_probe_operator.h"
+
+#include <gen_cpp/Descriptors_types.h>
+#include <gen_cpp/PlanNodes_types.h>
+#include <gen_cpp/Types_types.h>
+#include <gtest/gtest.h>
+
+#include <cstddef>
+#include <cstdint>
+#include <memory>
+#include <vector>
+
+#include "core/assert_cast.h"
+#include "core/block/block.h"
+#include "core/column/column_nullable.h"
+#include "core/column/column_vector.h"
+#include "core/data_type/data_type_nullable.h"
+#include "core/data_type/data_type_number.h"
+#include "exec/operator/nested_loop_join_build_operator.h"
+#include "exec/operator/operator.h"
+#include "exec/pipeline/dependency.h"
+#include "runtime/descriptor_helper.h"
+#include "testutil/column_helper.h"
+#include "testutil/creators.h"
+#include "testutil/mock/mock_operators.h"
+#include "testutil/mock/mock_runtime_state.h"
+
+namespace doris {
+
+class NLJProbeOperatorTest : public testing::Test {
+public:
+    void SetUp() override {
+        _runtime_state = std::make_unique<MockRuntimeState>();
+        _obj_pool = std::make_unique<ObjectPool>();
+        _runtime_profile = std::make_shared<RuntimeProfile>("test");
+        _query_ctx = generate_one_query();
+        _runtime_state->_query_ctx = _query_ctx.get();
+        _runtime_state->_query_id = _query_ctx->query_id();
+        _runtime_state->resize_op_id_to_local_state(-100);
+        _runtime_state->set_max_operator_id(-100);
+        ADD_TIMER(_runtime_profile.get(), "ExecTime");
+        _runtime_profile->AddHighWaterMarkCounter("MemoryUsed", TUnit::BYTES, 
"", 0);
+    }
+
+    void TearDown() override {}
+
+    // Build TPlanNode for NLJ with given join_op and is_mark.
+    // probe side: 1 INT column (non-nullable)
+    // build side: 1 INT column (non-nullable)
+    // For RIGHT_OUTER_JOIN, probe columns become nullable in 
intermediate/output.
+    TPlanNode create_nlj_plan_node(TJoinOp::type join_op, bool is_mark) {
+        TPlanNode tnode;
+        tnode.node_id = 0;
+        tnode.node_type = TPlanNodeType::CROSS_JOIN_NODE;
+        tnode.num_children = 2;
+        tnode.limit = -1;
+
+        TNestedLoopJoinNode nlj_node;
+        nlj_node.join_op = join_op;
+        nlj_node.__set_is_mark(is_mark);
+        tnode.__set_nested_loop_join_node(nlj_node);
+
+        // Build descriptor table:
+        //   tuple 0 = probe side (1 non-nullable INT slot)
+        //   tuple 1 = build side (1 non-nullable INT slot)
+        //   tuple 2 = intermediate (probe col nullable + build col nullable + 
mark col)
+        //   tuple 3 = output (same as intermediate)
+        TDescriptorTableBuilder builder;
+
+        // Probe side tuple (tuple 0)
+        TTupleDescriptorBuilder probe_tuple;
+        auto probe_slot = TSlotDescriptorBuilder()
+                                  .type(TYPE_INT)
+                                  .nullable(false)
+                                  .column_name("probe_col")
+                                  .build();
+        probe_slot.col_unique_id = 0;
+        probe_tuple.add_slot(probe_slot);
+        probe_tuple.build(&builder);
+
+        // Build side tuple (tuple 1)
+        TTupleDescriptorBuilder build_tuple;
+        auto build_slot = TSlotDescriptorBuilder()
+                                  .type(TYPE_INT)
+                                  .nullable(false)
+                                  .column_name("build_col")
+                                  .build();
+        build_slot.col_unique_id = 1;
+        build_tuple.add_slot(build_slot);
+        build_tuple.build(&builder);
+
+        // Intermediate tuple (tuple 2): probe col (nullable) + build col 
(nullable) + mark col
+        TTupleDescriptorBuilder intermediate_tuple;
+        auto inter_probe_slot = TSlotDescriptorBuilder()
+                                        .type(TYPE_INT)
+                                        .nullable(true)
+                                        .column_name("probe_col")
+                                        .build();
+        inter_probe_slot.col_unique_id = 10;
+        intermediate_tuple.add_slot(inter_probe_slot);
+
+        auto inter_build_slot = TSlotDescriptorBuilder()
+                                        .type(TYPE_INT)
+                                        .nullable(true)
+                                        .column_name("build_col")
+                                        .build();
+        inter_build_slot.col_unique_id = 11;
+        intermediate_tuple.add_slot(inter_build_slot);
+
+        if (is_mark) {
+            auto mark_slot = TSlotDescriptorBuilder()
+                                     .type(TYPE_BOOLEAN)
+                                     .nullable(true)
+                                     .column_name("mark")
+                                     .build();
+            mark_slot.col_unique_id = 12;
+            intermediate_tuple.add_slot(mark_slot);
+        }
+        intermediate_tuple.build(&builder);
+
+        // Output tuple (tuple 3): same layout as intermediate
+        TTupleDescriptorBuilder output_tuple;
+        auto out_probe_slot = TSlotDescriptorBuilder()
+                                      .type(TYPE_INT)
+                                      .nullable(true)
+                                      .column_name("probe_col")
+                                      .build();
+        out_probe_slot.col_unique_id = 20;
+        output_tuple.add_slot(out_probe_slot);
+
+        auto out_build_slot = TSlotDescriptorBuilder()
+                                      .type(TYPE_INT)
+                                      .nullable(true)
+                                      .column_name("build_col")
+                                      .build();
+        out_build_slot.col_unique_id = 21;
+        output_tuple.add_slot(out_build_slot);
+
+        if (is_mark) {
+            auto out_mark_slot = TSlotDescriptorBuilder()
+                                         .type(TYPE_BOOLEAN)
+                                         .nullable(true)
+                                         .column_name("mark")
+                                         .build();
+            out_mark_slot.col_unique_id = 22;
+            output_tuple.add_slot(out_mark_slot);
+        }
+        output_tuple.build(&builder);
+
+        tnode.row_tuples.push_back(0);
+        tnode.row_tuples.push_back(1);
+
+        nlj_node.vintermediate_tuple_id_list.push_back(2);
+        nlj_node.__isset.vintermediate_tuple_id_list = true;
+        tnode.__set_nested_loop_join_node(nlj_node);
+        tnode.__set_output_tuple_id(3);
+
+        // Build projection exprs: slot refs from intermediate to output
+        auto desc_table = builder.desc_tbl();
+        auto st = DescriptorTbl::create(_obj_pool.get(), desc_table, 
&_desc_tbl);
+        DCHECK(st.ok());
+        _runtime_state->set_desc_tbl(_desc_tbl);
+
+        // Projections: one SlotRef per output slot
+        std::vector<TExpr> projections;
+        for (auto& slot : desc_table.slotDescriptors) {
+            if (slot.parent == 2) { // intermediate tuple
+                TExpr expr;
+                TExprNode node;
+                node.node_type = TExprNodeType::SLOT_REF;
+                node.__set_is_nullable(slot.nullIndicatorByte >= 0);
+                node.num_children = 0;
+                node.__isset.slot_ref = true;
+                node.slot_ref.slot_id = slot.id;
+                node.slot_ref.col_unique_id = slot.col_unique_id;
+                node.slot_ref.__isset.col_unique_id = true;
+                node.type = slot.slotType;
+                expr.nodes.push_back(node);
+                projections.push_back(expr);
+            }
+        }
+        tnode.projections = projections;
+        tnode.__isset.projections = true;
+
+        return tnode;
+    }
+
+protected:
+    std::unique_ptr<MockRuntimeState> _runtime_state;
+    std::unique_ptr<ObjectPool> _obj_pool;
+    std::shared_ptr<QueryContext> _query_ctx;
+    std::shared_ptr<RuntimeProfile> _runtime_profile;
+    DescriptorTbl* _desc_tbl = nullptr;
+};
+
+// Exercises _append_probe_data_with_null through the full NLJ operator 
pipeline.
+// Trigger: RIGHT_OUTER_JOIN + mark join + empty build side + multi-row probe.
+// Before the fix, the null map was only extended by 1 instead of N, causing 
OOB.
+TEST_F(NLJProbeOperatorTest, AppendProbeDataWithNullMultiRow) {
+    auto tnode = create_nlj_plan_node(TJoinOp::RIGHT_OUTER_JOIN, true);
+
+    auto probe_operator =
+            std::make_shared<NestedLoopJoinProbeOperatorX>(_obj_pool.get(), 
tnode, 0, *_desc_tbl);
+    auto sink_operator = 
std::make_shared<NestedLoopJoinBuildSinkOperatorX>(_obj_pool.get(), 0, 0,
+                                                                            
tnode, *_desc_tbl);
+
+    // Wire up child operators
+    auto probe_source = std::make_shared<MockSourceOperator>();
+    auto build_source = std::make_shared<MockSourceOperator>();
+    auto probe_side_sink = std::make_shared<MockSinkOperator>();
+
+    RowDescriptor probe_row_desc(*_desc_tbl, {0});
+    probe_source->_row_descriptor = probe_row_desc;
+
+    RowDescriptor build_row_desc(*_desc_tbl, {1});
+    build_source->_row_descriptor = build_row_desc;
+
+    ASSERT_TRUE(sink_operator->set_child(build_source));
+    ASSERT_TRUE(probe_operator->set_child(probe_source));
+    ASSERT_TRUE(probe_operator->set_child(build_source));
+
+    // Create pipeline for PipelineTask
+    std::map<int,
+             std::pair<std::shared_ptr<BasicSharedState>, 
std::vector<std::shared_ptr<Dependency>>>>
+            shared_state_map;
+    auto [source_pipeline, _] =
+            generate_sort_pipeline(probe_operator, probe_side_sink, 
sink_operator, build_source);
+    auto pipeline_task = std::make_shared<PipelineTask>(source_pipeline, 0, 
_runtime_state.get(),
+                                                        nullptr, nullptr, 
shared_state_map, 0);
+
+    // Init and prepare operators
+    auto st = probe_operator->init(tnode, _runtime_state.get());
+    ASSERT_TRUE(st.ok()) << st.to_string();
+    st = probe_operator->prepare(_runtime_state.get());
+    ASSERT_TRUE(st.ok()) << st.to_string();
+
+    st = sink_operator->init(tnode, _runtime_state.get());
+    ASSERT_TRUE(st.ok()) << st.to_string();
+    st = sink_operator->prepare(_runtime_state.get());
+    ASSERT_TRUE(st.ok()) << st.to_string();
+
+    // Create shared state and set up local states
+    auto shared_state = sink_operator->create_shared_state();
+    ASSERT_TRUE(shared_state);
+
+    LocalSinkStateInfo sink_info {
+            .task_idx = 0,
+            .parent_profile = _runtime_profile.get(),
+            .sender_id = 0,
+            .shared_state = shared_state.get(),
+            .shared_state_map = {},
+            .tsink = TDataSink(),
+    };
+    st = sink_operator->setup_local_state(_runtime_state.get(), sink_info);
+    ASSERT_TRUE(st.ok()) << st.to_string();
+
+    LocalStateInfo probe_info {.parent_profile = _runtime_profile.get(),
+                               .scan_ranges = {},
+                               .shared_state = shared_state.get(),
+                               .shared_state_map = {},
+                               .task_idx = 0};
+    st = probe_operator->setup_local_state(_runtime_state.get(), probe_info);
+    ASSERT_TRUE(st.ok()) << st.to_string();
+
+    auto* sink_local_state =
+            
assert_cast<NestedLoopJoinBuildSinkLocalState*>(_runtime_state->get_sink_local_state());
+    ASSERT_TRUE(sink_local_state);
+    st = sink_local_state->open(_runtime_state.get());
+    ASSERT_TRUE(st.ok()) << st.to_string();
+
+    auto* probe_local_state = 
_runtime_state->get_local_state(probe_operator->operator_id());
+    ASSERT_TRUE(probe_local_state);
+    st = probe_local_state->open(_runtime_state.get());
+    ASSERT_TRUE(st.ok()) << st.to_string();
+
+    // Sink empty build side (eos=true, no data blocks)
+    Block empty_block;
+    st = sink_operator->sink(_runtime_state.get(), &empty_block, true);
+    ASSERT_TRUE(st.ok()) << st.to_string();
+
+    // Verify build side is empty — this is the trigger condition
+    auto& nlj_shared = 
assert_cast<NestedLoopJoinProbeLocalState*>(probe_local_state)
+                               ->_shared_state->build_blocks;
+    ASSERT_TRUE(nlj_shared.empty());
+
+    // Build probe block: 5 rows of non-nullable INT
+    Block probe_block;
+    auto probe_col = ColumnInt32::create();
+    for (int32_t i = 0; i < 5; ++i) {
+        probe_col->insert_value(i + 100);
+    }
+    probe_block.insert(ColumnWithTypeAndName(std::move(probe_col),
+                                             
std::make_shared<DataTypeInt32>(), "probe_col"));
+
+    // Push probe data through the operator
+    auto source_op = 
std::dynamic_pointer_cast<MockSourceOperator>(probe_operator->child());
+    ASSERT_TRUE(source_op);
+    source_op->set_block(std::move(probe_block));
+
+    Block output_block;
+    bool eos = false;
+    st = probe_operator->get_block_after_projects(_runtime_state.get(), 
&output_block, &eos);
+    ASSERT_TRUE(st.ok()) << st.to_string();
+
+    // The output should have 5 rows. Before the fix, this would crash or
+    // produce corrupted data due to null map / nested column size mismatch.
+    if (output_block.rows() > 0) {

Review Comment:
   This check becomes vacuous when the operator returns an empty block. The 
regression you are trying to lock down is that `_append_probe_data_with_null()` 
preserves all 5 probe rows, so this test should assert `output_block.rows() == 
5` (and preferably the expected null/default payload as well) before checking 
the nullable internals. Otherwise a future bug that drops the rows entirely 
would still pass here.



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