yiguolei commented on code in PR #10016:
URL: https://github.com/apache/incubator-doris/pull/10016#discussion_r893055237
##########
be/src/olap/rowset/segment_v2/parsed_page.h:
##########
@@ -67,17 +70,38 @@ struct ParsedPage {
return Status::OK();
}
- ~ParsedPage() {
- delete data_decoder;
- data_decoder = nullptr;
+ ParsedPage() = default;
+
+ ParsedPage(const ParsedPage& other) {
+ page_handle = other.page_handle;
+ has_null = other.has_null;
+ null_decoder = other.null_decoder;
+ null_bitmap = other.null_bitmap;
+ other.data_decoder->clone_for_cache(data_decoder);
+ first_ordinal = other.first_ordinal;
+ num_rows = other.num_rows;
+ first_array_item_ordinal = other.first_array_item_ordinal;
+ page_pointer = other.page_pointer;
+ page_index = other.page_index;
+ offset_in_page = other.offset_in_page;
}
- PageHandle page_handle;
+ ParsedPage& operator=(ParsedPage&& other) {
+ this->~ParsedPage();
+ new (this) ParsedPage(other);
+ return *this;
+ }
+
+ ~ParsedPage() { data_decoder = nullptr; }
Review Comment:
why set it to nullptr explictly?
--
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]