HappenLee commented on code in PR #62956:
URL: https://github.com/apache/doris/pull/62956#discussion_r3258624262


##########
be/src/exec/operator/nested_loop_join_probe_operator.cpp:
##########
@@ -177,6 +238,512 @@ void process_build_block(int64_t build_block_pos, Block& 
block, const Block& bui
     block.set_columns(std::move(dst_columns));
 }
 
+void NestedLoopJoinProbeLocalState::_replace_lazy_placeholder_columns(size_t 
rows) {
+    auto& p = _parent->cast<NestedLoopJoinProbeOperatorX>();
+    for (size_t i = 0; i < _join_block.columns(); ++i) {
+        if (p._materialize_column_ids.find(cast_set<int>(i)) != 
p._materialize_column_ids.end()) {
+            continue;
+        }
+        const auto& column = _join_block.get_by_position(i);
+        _join_block.replace_by_position(i,
+                                        
column.type->create_column_const_with_default_value(rows));
+    }
+}
+
+Status NestedLoopJoinProbeLocalState::_append_lazy_rows(const IColumn::Filter& 
filter,
+                                                        size_t selected_rows, 
bool fixed_side_probe,
+                                                        int64_t fixed_side_pos,
+                                                        const Block& 
probe_block,
+                                                        const Block& 
build_block) {
+    auto& p = _parent->cast<NestedLoopJoinProbeOperatorX>();
+    const size_t old_rows = _join_block.rows();
+    const size_t new_rows = old_rows + selected_rows;
+
+    if (p._materialize_column_ids.empty()) {
+        _replace_lazy_placeholder_columns(new_rows);
+        DCHECK_EQ(_join_block.rows(), new_rows);
+        return Status::OK();
+    }
+

Review Comment:
   ```
   if (!p._materialize_column_ids.empty()) {
   }
   
   _replace_lazy_placeholder_columns(new_rows);
           DCHECK_EQ(_join_block.rows(), new_rows);
           return Status::OK();
   ```
   no need repeated the code :
   ```
   _replace_lazy_placeholder_columns(new_rows);
           DCHECK_EQ(_join_block.rows(), new_rows);
           return Status::OK();
   ```
   



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