chaoyli commented on a change in pull request #311: Transform row-oriented
table to columnar-oriented table
URL: https://github.com/apache/incubator-doris/pull/311#discussion_r234114138
##########
File path: be/src/olap/store.cpp
##########
@@ -543,17 +543,74 @@ OLAPStatus
OlapStore::_load_table_from_header(OLAPEngine* engine, TTabletId tabl
}
OLAPStatus OlapStore::load_tables(OLAPEngine* engine) {
- auto load_table_func = [this, engine](long tablet_id,
- long schema_hash, const std::string& value) -> bool {
+ auto traverse_header_func = [this, engine](const std::string& key, const
std::string& value) -> bool {
+ std::vector<std::string> parts;
+ // key format: "hdr_" + tablet_id + "_" + schema_hash
+ split_string<char>(key, '_', &parts);
+ if (parts.size() != 3) {
+ LOG(WARNING) << "invalid header key:" << key << ", splitted size:"
<< parts.size();
+ return true;
+ }
+ TTabletId tablet_id = std::stol(parts[1].c_str(), NULL, 10);
+ TSchemaHash schema_hash = std::stol(parts[2].c_str(), NULL, 10);
OLAPStatus status = _load_table_from_header(engine, tablet_id,
schema_hash, value);
if (status != OLAP_SUCCESS) {
- LOG(WARNING) << "load table from header failed.tablet_id:" <<
tablet_id
- << ", schema_hash:" << schema_hash << ", status:" <<
status;
+ LOG(WARNING) << "load table from header failed. status:" << status
+ << "tablet=" << tablet_id << "." << schema_hash;
};
return true;
};
- OLAPStatus status = OlapHeaderManager::traverse_headers(_meta,
load_table_func);
+ OLAPStatus status = OlapHeaderManager::traverse_headers(_meta,
traverse_header_func);
return status;
}
+OLAPStatus OlapStore::check_none_row_oriented_table_in_store(OLAPEngine*
engine) {
+ auto traverse_header_func = [this, engine](const std::string& key, const
std::string& value) -> bool {
+ std::vector<std::string> parts;
+ // key format: "hdr_" + tablet_id + "_" + schema_hash
+ split_string<char>(key, '_', &parts);
+ if (parts.size() != 3) {
+ LOG(WARNING) << "invalid header key:" << key << ", splitted size:"
<< parts.size();
+ return true;
+ }
+ TTabletId tablet_id = std::stol(parts[1].c_str(), NULL, 10);
+ TSchemaHash schema_hash = std::stol(parts[2].c_str(), NULL, 10);
Review comment:
I will reset to last version.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]