aryash45 commented on code in PR #60783:
URL: https://github.com/apache/doris/pull/60783#discussion_r2825789210
##########
be/src/vec/core/block.cpp:
##########
@@ -958,12 +958,27 @@ Status MutableBlock::add_rows(const Block* block, const
uint32_t* row_begin,
DCHECK_EQ(columns(), column_offset->size());
}
const auto& block_data = block->get_columns_with_type_and_name();
+
+ // Validate all row indices before processing any column.
+ // All columns in a block share the same row count, so we only need to
+ // check against the first column's size.
+ if (row_begin != row_end && !block_data.empty()) {
Review Comment:
Thanks for the feedback! @yiguolei I agree that the O(N) validation check
is too heavy for release builds.
I have updated the code to wrap the validation logic in #ifndef NDEBUG. This
ensures the check is performed during development/debug builds to catch issues
early, but is completely compiled out in release builds to avoid any
performance penalty
--
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]