hust-hhb commented on code in PR #32200:
URL: https://github.com/apache/doris/pull/32200#discussion_r1543303927
##########
be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp:
##########
@@ -809,8 +825,26 @@ Status VerticalSegmentWriter::write_batch() {
_olap_data_convertor->clear_source_content();
_num_rows_written += data.num_rows;
}
-
_batched_blocks.clear();
+ _full_blocks.clear();
+ return Status::OK();
+}
+
+Status
VerticalSegmentWriter::_make_full_block(std::shared_ptr<vectorized::Block>&
block_ptr,
+ const vectorized::Block* block,
size_t num_rows) {
+ block_ptr =
std::make_shared<vectorized::Block>(_tablet_schema->create_block());
+ const auto& including_cids =
_opts.rowset_ctx->partial_update_info->update_cids;
+ size_t input_id = 0;
+ for (auto i : including_cids) {
+ block_ptr->replace_by_position(i,
block->get_by_position(input_id++).column);
+ }
+ std::vector<bool> use_default_or_null_flag;
+ use_default_or_null_flag.reserve(num_rows);
+ auto mutable_full_columns = block_ptr->mutate_columns();
+ for (size_t block_pos = 0; block_pos < num_rows; block_pos++) {
+ use_default_or_null_flag.emplace_back(true);
+ }
+ RETURN_IF_ERROR(_fill_missing_columns(mutable_full_columns,
use_default_or_null_flag, true, 0));
Review Comment:
In my test, for agg table partial update, the missing columns will fill with
NULL even though it has default value, because it agg type is
REPLACE_IF_NOT_NULL which make column type is nullable, and NULL value will be
ignore when doing compaciton or query. This point is different with original
agg table partial update, becasue original agg table partial update will fill
default value into missing column instead of NULL, and after partial update,
the missing column's value will become default value.
--
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]