Skip to content

Commit

Permalink
r
Browse files Browse the repository at this point in the history
  • Loading branch information
mymeiyi committed Dec 2, 2024
1 parent f845dd3 commit 3304640
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion be/src/olap/tablet_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,16 @@ Status TabletReader::_init_orderby_keys_param(const ReaderParams& read_params) {
_tablet->enable_unique_key_merge_on_write())) {
if (!_tablet_schema->cluster_key_idxes().empty()) {
for (uint32_t i = 0; i < read_params.read_orderby_key_num_prefix_columns; i++) {
auto index = _tablet_schema->cluster_key_idxes()[i];
auto cid = _tablet_schema->cluster_key_idxes()[i];
auto index = _tablet_schema->field_index(cid);
if (index < 0) {
return Status::Error<ErrorCode::INTERNAL_ERROR>(
"could not find cluster key column with unique_id=" +
std::to_string(cid) + " in tablet schema, tablet_id=" +
std::to_string(_tablet->tablet_id()));
}
LOG(INFO) << "sout: tablet_id=" << _tablet->tablet_id() << ", cid=" << cid
<< ", index=" << index;
for (uint32_t idx = 0; idx < _return_columns.size(); idx++) {
if (_return_columns[idx] == index) {
_orderby_key_columns.push_back(idx);
Expand Down
1 change: 1 addition & 0 deletions be/src/olap/tablet_schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ class TabletSchema : public MetadataAdder<TabletSchema> {
size_t _num_columns = 0;
size_t _num_variant_columns = 0;
size_t _num_key_columns = 0;
// cluster key column unique ids
std::vector<uint32_t> _cluster_key_idxes;
size_t _num_null_columns = 0;
size_t _num_short_key_columns = 0;
Expand Down

0 comments on commit 3304640

Please sign in to comment.