This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 20143967078 [fix](block) add block columns size dcheck (#28539)
20143967078 is described below
commit 20143967078e3959a505fd1bedc88f8447e1bb27
Author: nanfeng <[email protected]>
AuthorDate: Sat Dec 23 15:21:53 2023 +0800
[fix](block) add block columns size dcheck (#28539)
---
be/src/vec/core/block.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/be/src/vec/core/block.cpp b/be/src/vec/core/block.cpp
index a7965d03ce3..544a558afc0 100644
--- a/be/src/vec/core/block.cpp
+++ b/be/src/vec/core/block.cpp
@@ -584,7 +584,9 @@ MutableColumns Block::mutate_columns() {
}
void Block::set_columns(MutableColumns&& columns) {
- /// TODO: assert if |columns| doesn't match |data|!
+ DCHECK_GE(columns.size(), data.size())
+ << fmt::format("Invalid size of columns, columns size: {}, data
size: {}",
+ columns.size(), data.size());
size_t num_columns = data.size();
for (size_t i = 0; i < num_columns; ++i) {
data[i].column = std::move(columns[i]);
@@ -592,7 +594,9 @@ void Block::set_columns(MutableColumns&& columns) {
}
void Block::set_columns(const Columns& columns) {
- /// TODO: assert if |columns| doesn't match |data|!
+ DCHECK_GE(columns.size(), data.size())
+ << fmt::format("Invalid size of columns, columns size: {}, data
size: {}",
+ columns.size(), data.size());
size_t num_columns = data.size();
for (size_t i = 0; i < num_columns; ++i) {
data[i].column = columns[i];
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]