This is an automated email from the ASF dual-hosted git repository.
zhaoc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new da2838e Set AGG_KEYS upon upgrade from tablet if has_keys_type() is
false (#2620)
da2838e is described below
commit da2838e5fef16588df0ebf421d0df352d41c5136
Author: lichaoyong <[email protected]>
AuthorDate: Mon Dec 30 23:17:16 2019 +0800
Set AGG_KEYS upon upgrade from tablet if has_keys_type() is false (#2620)
Doris support AGG_KEYS/UNIQUE_KEYS/DUP_KEYS/ three storage model.
Among these three model, UNIQUE_KYES/DUP_KEYS is added after AGG_KEYS.
For historical tablet, the keys_type field to indicate storage model
may be missed for AGG_KEYS.
So upgrade from historical tablet, this situation should be taken into
consideration and set to be AGG_KEYS.
---
be/src/olap/olap_snapshot_converter.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/be/src/olap/olap_snapshot_converter.cpp
b/be/src/olap/olap_snapshot_converter.cpp
index 050ee67..23cf4fd 100755
--- a/be/src/olap/olap_snapshot_converter.cpp
+++ b/be/src/olap/olap_snapshot_converter.cpp
@@ -109,7 +109,16 @@ OLAPStatus OlapSnapshotConverter::to_tablet_meta_pb(const
OLAPHeaderMessage& ola
}
if (olap_header.has_keys_type()) {
schema->set_keys_type(olap_header.keys_type());
+ } else {
+ // Doris support AGG_KEYS/UNIQUE_KEYS/DUP_KEYS/ three storage model.
+ // Among these three model, UNIQUE_KYES/DUP_KEYS is added after
AGG_KEYS.
+ // For historical tablet, the keys_type field to indicate storage model
+ // may be missed for AGG_KEYS.
+ // So upgrade from historical tablet, this situation should be taken
into
+ // consideration and set to be AGG_KEYS.
+ schema->set_keys_type(KeysType::AGG_KEYS);
}
+
schema->set_num_short_key_columns(olap_header.num_short_key_fields());
schema->set_num_rows_per_row_block(olap_header.num_rows_per_data_block());
schema->set_compress_kind(olap_header.compress_kind());
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]