This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 1dbaaa758b5 [fix] (schema change) fix missing data bug in schema
change (#28938)
1dbaaa758b5 is described below
commit 1dbaaa758b5f0c4100a4a633684c1724209f9861
Author: Luwei <[email protected]>
AuthorDate: Sun Dec 24 20:40:32 2023 +0800
[fix] (schema change) fix missing data bug in schema change (#28938)
---
be/src/olap/schema_change.cpp | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp
index acd468a47e8..fc20ecab35d 100644
--- a/be/src/olap/schema_change.cpp
+++ b/be/src/olap/schema_change.cpp
@@ -477,6 +477,7 @@ Status
VSchemaChangeDirectly::_inner_process(RowsetReaderSharedPtr rowset_reader
RowsetWriter* rowset_writer,
TabletSharedPtr new_tablet,
TabletSchemaSPtr
base_tablet_schema) {
+ bool eof = false;
do {
auto new_block =
vectorized::Block::create_unique(new_tablet->tablet_schema()->create_block());
@@ -485,14 +486,15 @@ Status
VSchemaChangeDirectly::_inner_process(RowsetReaderSharedPtr rowset_reader
auto st = rowset_reader->next_block(ref_block.get());
if (!st) {
if (st.is<ErrorCode::END_OF_FILE>()) {
- break;
+ eof = true;
+ } else {
+ return st;
}
- return st;
}
RETURN_IF_ERROR(_changer.change_block(ref_block.get(),
new_block.get()));
RETURN_IF_ERROR(rowset_writer->add_block(new_block.get()));
- } while (true);
+ } while (!eof);
RETURN_IF_ERROR(rowset_writer->flush());
return Status::OK();
@@ -553,14 +555,16 @@ Status
VSchemaChangeWithSorting::_inner_process(RowsetReaderSharedPtr rowset_rea
auto new_block =
vectorized::Block::create_unique(new_tablet->tablet_schema()->create_block());
+ bool eof = false;
do {
auto ref_block =
vectorized::Block::create_unique(base_tablet_schema->create_block());
auto st = rowset_reader->next_block(ref_block.get());
if (!st) {
if (st.is<ErrorCode::END_OF_FILE>()) {
- break;
+ eof = true;
+ } else {
+ return st;
}
- return st;
}
RETURN_IF_ERROR(_changer.change_block(ref_block.get(),
new_block.get()));
@@ -581,7 +585,7 @@ Status
VSchemaChangeWithSorting::_inner_process(RowsetReaderSharedPtr rowset_rea
blocks.push_back(
vectorized::Block::create_unique(new_tablet->tablet_schema()->create_block()));
swap(blocks.back(), new_block);
- } while (true);
+ } while (!eof);
RETURN_IF_ERROR(create_rowset());
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]