Coverage Report

Created: 2025-04-27 11:50

/root/doris/be/src/exec/rowid_fetcher.cpp
Line
Count
Source (jump to first uncovered line)
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "exec/rowid_fetcher.h"
19
20
#include <brpc/callback.h>
21
#include <butil/endpoint.h>
22
#include <fmt/format.h>
23
#include <gen_cpp/data.pb.h>
24
#include <gen_cpp/internal_service.pb.h>
25
#include <gen_cpp/olap_file.pb.h>
26
#include <gen_cpp/types.pb.h>
27
#include <glog/logging.h>
28
#include <stddef.h>
29
#include <stdint.h>
30
31
#include <algorithm>
32
#include <cstdint>
33
#include <memory>
34
#include <ostream>
35
#include <string>
36
#include <unordered_map>
37
#include <utility>
38
#include <vector>
39
40
#include "bthread/countdown_event.h"
41
#include "cloud/cloud_storage_engine.h"
42
#include "cloud/cloud_tablet.h"
43
#include "cloud/cloud_tablet_mgr.h"
44
#include "cloud/config.h"
45
#include "common/config.h"
46
#include "common/consts.h"
47
#include "common/exception.h"
48
#include "exec/tablet_info.h" // DorisNodesInfo
49
#include "olap/olap_common.h"
50
#include "olap/rowset/beta_rowset.h"
51
#include "olap/storage_engine.h"
52
#include "olap/tablet_fwd.h"
53
#include "olap/tablet_manager.h"
54
#include "olap/tablet_schema.h"
55
#include "olap/utils.h"
56
#include "runtime/descriptors.h"
57
#include "runtime/exec_env.h"      // ExecEnv
58
#include "runtime/runtime_state.h" // RuntimeState
59
#include "runtime/types.h"
60
#include "util/brpc_client_cache.h" // BrpcClientCache
61
#include "util/defer_op.h"
62
#include "vec/columns/column.h"
63
#include "vec/columns/column_nullable.h"
64
#include "vec/columns/column_string.h"
65
#include "vec/common/assert_cast.h"
66
#include "vec/common/string_ref.h"
67
#include "vec/core/block.h" // Block
68
#include "vec/data_types/data_type_factory.hpp"
69
#include "vec/data_types/data_type_struct.h"
70
#include "vec/data_types/serde/data_type_serde.h"
71
#include "vec/functions/function_helpers.h"
72
#include "vec/jsonb/serialize.h"
73
74
namespace doris {
75
76
0
Status RowIDFetcher::init() {
77
0
    DorisNodesInfo nodes_info;
78
0
    nodes_info.setNodes(_fetch_option.t_fetch_opt.nodes_info);
79
0
    for (auto [node_id, node_info] : nodes_info.nodes_info()) {
80
0
        auto client = ExecEnv::GetInstance()->brpc_internal_client_cache()->get_client(
81
0
                node_info.host, node_info.brpc_port);
82
0
        if (!client) {
83
0
            LOG(WARNING) << "Get rpc stub failed, host=" << node_info.host
84
0
                         << ", port=" << node_info.brpc_port;
85
0
            return Status::InternalError("RowIDFetcher failed to init rpc client, host={}, port={}",
86
0
                                         node_info.host, node_info.brpc_port);
87
0
        }
88
0
        _stubs.push_back(client);
89
0
    }
90
0
    return Status::OK();
91
0
}
92
93
0
PMultiGetRequest RowIDFetcher::_init_fetch_request(const vectorized::ColumnString& row_locs) const {
94
0
    PMultiGetRequest mget_req;
95
0
    _fetch_option.desc->to_protobuf(mget_req.mutable_desc());
96
0
    for (SlotDescriptor* slot : _fetch_option.desc->slots()) {
97
        // ignore rowid
98
0
        if (slot->col_name() == BeConsts::ROWID_COL) {
99
0
            continue;
100
0
        }
101
0
        slot->to_protobuf(mget_req.add_slots());
102
0
    }
103
0
    for (size_t i = 0; i < row_locs.size(); ++i) {
104
0
        PRowLocation row_loc;
105
0
        StringRef row_id_rep = row_locs.get_data_at(i);
106
        // TODO: When transferring data between machines with different byte orders (endianness),
107
        // not performing proper handling may lead to issues in parsing and exchanging the data.
108
0
        auto location = reinterpret_cast<const GlobalRowLoacation*>(row_id_rep.data);
109
0
        row_loc.set_tablet_id(location->tablet_id);
110
0
        row_loc.set_rowset_id(location->row_location.rowset_id.to_string());
111
0
        row_loc.set_segment_id(location->row_location.segment_id);
112
0
        row_loc.set_ordinal_id(location->row_location.row_id);
113
0
        *mget_req.add_row_locs() = std::move(row_loc);
114
0
    }
115
    // Set column desc
116
0
    for (const TColumn& tcolumn : _fetch_option.t_fetch_opt.column_desc) {
117
0
        TabletColumn column(tcolumn);
118
0
        column.to_schema_pb(mget_req.add_column_desc());
119
0
    }
120
0
    PUniqueId& query_id = *mget_req.mutable_query_id();
121
0
    query_id.set_hi(_fetch_option.runtime_state->query_id().hi);
122
0
    query_id.set_lo(_fetch_option.runtime_state->query_id().lo);
123
0
    mget_req.set_be_exec_version(_fetch_option.runtime_state->be_exec_version());
124
0
    mget_req.set_fetch_row_store(_fetch_option.t_fetch_opt.fetch_row_store);
125
0
    return mget_req;
126
0
}
127
128
0
static void fetch_callback(bthread::CountdownEvent* counter) {
129
0
    Defer __defer([&] { counter->signal(); });
130
0
}
131
132
Status RowIDFetcher::_merge_rpc_results(const PMultiGetRequest& request,
133
                                        const std::vector<PMultiGetResponse>& rsps,
134
                                        const std::vector<brpc::Controller>& cntls,
135
                                        vectorized::Block* output_block,
136
0
                                        std::vector<PRowLocation>* rows_id) const {
137
0
    output_block->clear();
138
0
    for (const auto& cntl : cntls) {
139
0
        if (cntl.Failed()) {
140
0
            LOG(WARNING) << "Failed to fetch meet rpc error:" << cntl.ErrorText()
141
0
                         << ", host:" << cntl.remote_side();
142
0
            return Status::InternalError(cntl.ErrorText());
143
0
        }
144
0
    }
145
0
    vectorized::DataTypeSerDeSPtrs serdes;
146
0
    std::unordered_map<uint32_t, uint32_t> col_uid_to_idx;
147
0
    std::vector<std::string> default_values;
148
0
    default_values.resize(_fetch_option.desc->slots().size());
149
0
    auto merge_function = [&](const PMultiGetResponse& resp) {
150
0
        Status st(Status::create(resp.status()));
151
0
        if (!st.ok()) {
152
0
            LOG(WARNING) << "Failed to fetch " << st.to_string();
153
0
            return st;
154
0
        }
155
0
        for (const PRowLocation& row_id : resp.row_locs()) {
156
0
            rows_id->push_back(row_id);
157
0
        }
158
        // Merge binary rows
159
0
        if (request.fetch_row_store()) {
160
0
            CHECK(resp.row_locs().size() == resp.binary_row_data_size());
161
0
            if (output_block->is_empty_column()) {
162
0
                *output_block = vectorized::Block(_fetch_option.desc->slots(), 1);
163
0
            }
164
0
            if (serdes.empty() && col_uid_to_idx.empty()) {
165
0
                serdes = vectorized::create_data_type_serdes(_fetch_option.desc->slots());
166
0
                for (int i = 0; i < _fetch_option.desc->slots().size(); ++i) {
167
0
                    col_uid_to_idx[_fetch_option.desc->slots()[i]->col_unique_id()] = i;
168
0
                    default_values[i] = _fetch_option.desc->slots()[i]->col_default_value();
169
0
                }
170
0
            }
171
0
            for (int i = 0; i < resp.binary_row_data_size(); ++i) {
172
0
                vectorized::JsonbSerializeUtil::jsonb_to_block(
173
0
                        serdes, resp.binary_row_data(i).data(), resp.binary_row_data(i).size(),
174
0
                        col_uid_to_idx, *output_block, default_values, {});
175
0
            }
176
0
            return Status::OK();
177
0
        }
178
        // Merge partial blocks
179
0
        vectorized::Block partial_block;
180
0
        RETURN_IF_ERROR(partial_block.deserialize(resp.block()));
181
0
        if (partial_block.is_empty_column()) {
182
0
            return Status::OK();
183
0
        }
184
0
        CHECK(resp.row_locs().size() == partial_block.rows());
185
0
        if (output_block->is_empty_column()) {
186
0
            output_block->swap(partial_block);
187
0
        } else if (partial_block.columns() != output_block->columns()) {
188
0
            return Status::Error<ErrorCode::INTERNAL_ERROR>(
189
0
                    "Merge block not match, self:[{}], input:[{}], ", output_block->dump_types(),
190
0
                    partial_block.dump_types());
191
0
        } else {
192
0
            for (int i = 0; i < output_block->columns(); ++i) {
193
0
                output_block->get_by_position(i).column->assume_mutable()->insert_range_from(
194
0
                        *partial_block.get_by_position(i)
195
0
                                 .column->convert_to_full_column_if_const()
196
0
                                 .get(),
197
0
                        0, partial_block.rows());
198
0
            }
199
0
        }
200
0
        return Status::OK();
201
0
    };
202
203
0
    for (const auto& resp : rsps) {
204
0
        RETURN_IF_ERROR(merge_function(resp));
205
0
    }
206
0
    return Status::OK();
207
0
}
208
209
0
bool _has_char_type(const vectorized::DataTypePtr& type) {
210
0
    switch (type->get_primitive_type()) {
211
0
    case TYPE_CHAR: {
212
0
        return true;
213
0
    }
214
0
    case TYPE_ARRAY: {
215
0
        const auto* arr_type =
216
0
                assert_cast<const vectorized::DataTypeArray*>(remove_nullable(type).get());
217
0
        return _has_char_type(arr_type->get_nested_type());
218
0
    }
219
0
    case TYPE_MAP: {
220
0
        const auto* map_type =
221
0
                assert_cast<const vectorized::DataTypeMap*>(remove_nullable(type).get());
222
0
        return _has_char_type(map_type->get_key_type()) ||
223
0
               _has_char_type(map_type->get_value_type());
224
0
    }
225
0
    case TYPE_STRUCT: {
226
0
        const auto* struct_type =
227
0
                assert_cast<const vectorized::DataTypeStruct*>(remove_nullable(type).get());
228
0
        return std::any_of(
229
0
                struct_type->get_elements().begin(), struct_type->get_elements().end(),
230
0
                [&](const vectorized::DataTypePtr& dt) -> bool { return _has_char_type(dt); });
231
0
    }
232
0
    default:
233
0
        return false;
234
0
    }
235
0
}
236
237
Status RowIDFetcher::fetch(const vectorized::ColumnPtr& column_row_ids,
238
0
                           vectorized::Block* res_block) {
239
0
    CHECK(!_stubs.empty());
240
0
    PMultiGetRequest mget_req = _init_fetch_request(assert_cast<const vectorized::ColumnString&>(
241
0
            *vectorized::remove_nullable(column_row_ids).get()));
242
0
    std::vector<PMultiGetResponse> resps(_stubs.size());
243
0
    std::vector<brpc::Controller> cntls(_stubs.size());
244
0
    bthread::CountdownEvent counter(_stubs.size());
245
0
    for (size_t i = 0; i < _stubs.size(); ++i) {
246
0
        cntls[i].set_timeout_ms(config::fetch_rpc_timeout_seconds * 1000);
247
0
        auto callback = brpc::NewCallback(fetch_callback, &counter);
248
0
        _stubs[i]->multiget_data(&cntls[i], &mget_req, &resps[i], callback);
249
0
    }
250
0
    counter.wait();
251
252
    // Merge
253
0
    std::vector<PRowLocation> rows_locs;
254
0
    rows_locs.reserve(rows_locs.size());
255
0
    RETURN_IF_ERROR(_merge_rpc_results(mget_req, resps, cntls, res_block, &rows_locs));
256
0
    if (rows_locs.size() < column_row_ids->size()) {
257
0
        return Status::InternalError("Miss matched return row loc count {}, expected {}, input {}",
258
0
                                     rows_locs.size(), res_block->rows(), column_row_ids->size());
259
0
    }
260
    // Final sort by row_ids sequence, since row_ids is already sorted if need
261
0
    std::map<GlobalRowLoacation, size_t> positions;
262
0
    for (size_t i = 0; i < rows_locs.size(); ++i) {
263
0
        RowsetId rowset_id;
264
0
        rowset_id.init(rows_locs[i].rowset_id());
265
0
        GlobalRowLoacation grl(rows_locs[i].tablet_id(), rowset_id, rows_locs[i].segment_id(),
266
0
                               rows_locs[i].ordinal_id());
267
0
        positions[grl] = i;
268
0
    };
269
    // TODO remove this warning code
270
0
    if (positions.size() < rows_locs.size()) {
271
0
        LOG(WARNING) << "contains duplicated row entry";
272
0
    }
273
0
    vectorized::IColumn::Permutation permutation;
274
0
    permutation.reserve(column_row_ids->size());
275
0
    for (size_t i = 0; i < column_row_ids->size(); ++i) {
276
0
        auto location =
277
0
                reinterpret_cast<const GlobalRowLoacation*>(column_row_ids->get_data_at(i).data);
278
0
        permutation.push_back(positions[*location]);
279
0
    }
280
0
    for (size_t i = 0; i < res_block->columns(); ++i) {
281
0
        res_block->get_by_position(i).column =
282
0
                res_block->get_by_position(i).column->permute(permutation, permutation.size());
283
0
    }
284
    // Check row consistency
285
0
    RETURN_IF_CATCH_EXCEPTION(res_block->check_number_of_rows());
286
    // shrink for char type
287
0
    std::vector<size_t> char_type_idx;
288
0
    for (size_t i = 0; i < _fetch_option.desc->slots().size(); i++) {
289
0
        const auto& column_desc = _fetch_option.desc->slots()[i];
290
0
        const auto type = column_desc->type();
291
0
        if (_has_char_type(type)) {
292
0
            char_type_idx.push_back(i);
293
0
        }
294
0
    }
295
0
    res_block->shrink_char_type_column_suffix_zero(char_type_idx);
296
0
    VLOG_DEBUG << "dump block:" << res_block->dump_data(0, 10);
297
0
    return Status::OK();
298
0
}
299
300
template <typename Func>
301
0
auto scope_timer_run(Func fn, int64_t* cost) -> decltype(fn()) {
302
0
    MonotonicStopWatch watch;
303
0
    watch.start();
304
0
    auto res = fn();
305
0
    *cost += watch.elapsed_time() / 1000 / 1000;
306
0
    return res;
307
0
}
Unexecuted instantiation: rowid_fetcher.cpp:_ZN5doris15scope_timer_runIZNS_18RowIdStorageReader14read_by_rowidsERKNS_16PMultiGetRequestEPNS_17PMultiGetResponseEE3$_1EEDTclfp_EET_Pl
Unexecuted instantiation: rowid_fetcher.cpp:_ZN5doris15scope_timer_runIZNS_18RowIdStorageReader14read_by_rowidsERKNS_16PMultiGetRequestEPNS_17PMultiGetResponseEE3$_2EEDTclfp_EET_Pl
Unexecuted instantiation: rowid_fetcher.cpp:_ZN5doris15scope_timer_runIZNS_18RowIdStorageReader14read_by_rowidsERKNS_16PMultiGetRequestEPNS_17PMultiGetResponseEE3$_4EEDTclfp_EET_Pl
Unexecuted instantiation: rowid_fetcher.cpp:_ZN5doris15scope_timer_runIZNS_18RowIdStorageReader14read_by_rowidsERKNS_16PMultiGetRequestEPNS_17PMultiGetResponseEE3$_5EEDTclfp_EET_Pl
308
309
struct IteratorKey {
310
    int64_t tablet_id;
311
    RowsetId rowset_id;
312
    uint64_t segment_id;
313
    int slot_id;
314
315
    // unordered map std::equal_to
316
0
    bool operator==(const IteratorKey& rhs) const {
317
0
        return tablet_id == rhs.tablet_id && rowset_id == rhs.rowset_id &&
318
0
               segment_id == rhs.segment_id && slot_id == rhs.slot_id;
319
0
    }
320
};
321
322
struct HashOfIteratorKey {
323
0
    size_t operator()(const IteratorKey& key) const {
324
0
        size_t seed = 0;
325
0
        seed = HashUtil::hash64(&key.tablet_id, sizeof(key.tablet_id), seed);
326
0
        seed = HashUtil::hash64(&key.rowset_id.hi, sizeof(key.rowset_id.hi), seed);
327
0
        seed = HashUtil::hash64(&key.rowset_id.mi, sizeof(key.rowset_id.mi), seed);
328
0
        seed = HashUtil::hash64(&key.rowset_id.lo, sizeof(key.rowset_id.lo), seed);
329
0
        seed = HashUtil::hash64(&key.segment_id, sizeof(key.segment_id), seed);
330
0
        seed = HashUtil::hash64(&key.slot_id, sizeof(key.slot_id), seed);
331
0
        return seed;
332
0
    }
333
};
334
335
struct IteratorItem {
336
    std::unique_ptr<ColumnIterator> iterator;
337
    // for holding the reference of segment to avoid use after release
338
    SegmentSharedPtr segment;
339
};
340
341
Status RowIdStorageReader::read_by_rowids(const PMultiGetRequest& request,
342
0
                                          PMultiGetResponse* response) {
343
    // read from storage engine row id by row id
344
0
    OlapReaderStatistics stats;
345
0
    vectorized::Block result_block;
346
0
    int64_t acquire_tablet_ms = 0;
347
0
    int64_t acquire_rowsets_ms = 0;
348
0
    int64_t acquire_segments_ms = 0;
349
0
    int64_t lookup_row_data_ms = 0;
350
351
    // init desc
352
0
    std::vector<SlotDescriptor> slots;
353
0
    slots.reserve(request.slots().size());
354
0
    for (const auto& pslot : request.slots()) {
355
0
        slots.push_back(SlotDescriptor(pslot));
356
0
    }
357
358
    // init read schema
359
0
    TabletSchema full_read_schema;
360
0
    for (const ColumnPB& column_pb : request.column_desc()) {
361
0
        full_read_schema.append_column(TabletColumn(column_pb));
362
0
    }
363
364
0
    std::unordered_map<IteratorKey, IteratorItem, HashOfIteratorKey> iterator_map;
365
    // read row by row
366
0
    for (size_t i = 0; i < request.row_locs_size(); ++i) {
367
0
        const auto& row_loc = request.row_locs(i);
368
0
        MonotonicStopWatch watch;
369
0
        watch.start();
370
0
        BaseTabletSPtr tablet = scope_timer_run(
371
0
                [&]() {
372
0
                    auto res = ExecEnv::get_tablet(row_loc.tablet_id());
373
0
                    return !res.has_value() ? nullptr
374
0
                                            : std::dynamic_pointer_cast<BaseTablet>(res.value());
375
0
                },
376
0
                &acquire_tablet_ms);
377
0
        RowsetId rowset_id;
378
0
        rowset_id.init(row_loc.rowset_id());
379
0
        if (!tablet) {
380
0
            continue;
381
0
        }
382
        // We ensured it's rowset is not released when init Tablet reader param, rowset->update_delayed_expired_timestamp();
383
0
        BetaRowsetSharedPtr rowset = std::static_pointer_cast<BetaRowset>(scope_timer_run(
384
0
                [&]() {
385
0
                    return ExecEnv::GetInstance()->storage_engine().get_quering_rowset(rowset_id);
386
0
                },
387
0
                &acquire_rowsets_ms));
388
0
        if (!rowset) {
389
0
            LOG(INFO) << "no such rowset " << rowset_id;
390
0
            continue;
391
0
        }
392
0
        size_t row_size = 0;
393
0
        Defer _defer([&]() {
394
0
            LOG_EVERY_N(INFO, 100)
395
0
                    << "multiget_data single_row, cost(us):" << watch.elapsed_time() / 1000
396
0
                    << ", row_size:" << row_size;
397
0
            *response->add_row_locs() = row_loc;
398
0
        });
399
        // TODO: supoort session variable enable_page_cache and disable_file_cache if necessary.
400
0
        SegmentCacheHandle segment_cache;
401
0
        RETURN_IF_ERROR(scope_timer_run(
402
0
                [&]() {
403
0
                    return SegmentLoader::instance()->load_segments(rowset, &segment_cache, true);
404
0
                },
405
0
                &acquire_segments_ms));
406
        // find segment
407
0
        auto it = std::find_if(segment_cache.get_segments().cbegin(),
408
0
                               segment_cache.get_segments().cend(),
409
0
                               [&row_loc](const segment_v2::SegmentSharedPtr& seg) {
410
0
                                   return seg->id() == row_loc.segment_id();
411
0
                               });
412
0
        if (it == segment_cache.get_segments().end()) {
413
0
            continue;
414
0
        }
415
0
        segment_v2::SegmentSharedPtr segment = *it;
416
0
        GlobalRowLoacation row_location(row_loc.tablet_id(), rowset->rowset_id(),
417
0
                                        row_loc.segment_id(), row_loc.ordinal_id());
418
        // fetch by row store, more effcient way
419
0
        if (request.fetch_row_store()) {
420
0
            CHECK(tablet->tablet_schema()->has_row_store_for_all_columns());
421
0
            RowLocation loc(rowset_id, segment->id(), row_loc.ordinal_id());
422
0
            string* value = response->add_binary_row_data();
423
0
            RETURN_IF_ERROR(scope_timer_run(
424
0
                    [&]() { return tablet->lookup_row_data({}, loc, rowset, stats, *value); },
425
0
                    &lookup_row_data_ms));
426
0
            row_size = value->size();
427
0
            continue;
428
0
        }
429
430
        // fetch by column store
431
0
        if (result_block.is_empty_column()) {
432
0
            result_block = vectorized::Block(slots, request.row_locs().size());
433
0
        }
434
0
        VLOG_DEBUG << "Read row location "
435
0
                   << fmt::format("{}, {}, {}, {}", row_location.tablet_id,
436
0
                                  row_location.row_location.rowset_id.to_string(),
437
0
                                  row_location.row_location.segment_id,
438
0
                                  row_location.row_location.row_id);
439
0
        for (int x = 0; x < slots.size(); ++x) {
440
0
            auto row_id = static_cast<segment_v2::rowid_t>(row_loc.ordinal_id());
441
0
            vectorized::MutableColumnPtr column =
442
0
                    result_block.get_by_position(x).column->assume_mutable();
443
0
            IteratorKey iterator_key {.tablet_id = tablet->tablet_id(),
444
0
                                      .rowset_id = rowset_id,
445
0
                                      .segment_id = row_loc.segment_id(),
446
0
                                      .slot_id = slots[x].id()};
447
0
            IteratorItem& iterator_item = iterator_map[iterator_key];
448
0
            if (iterator_item.segment == nullptr) {
449
                // hold the reference
450
0
                iterator_map[iterator_key].segment = segment;
451
0
            }
452
0
            segment = iterator_item.segment;
453
0
            RETURN_IF_ERROR(segment->seek_and_read_by_rowid(full_read_schema, &slots[x], row_id,
454
0
                                                            column, stats, iterator_item.iterator));
455
0
        }
456
0
    }
457
    // serialize block if not empty
458
0
    if (!result_block.is_empty_column()) {
459
0
        VLOG_DEBUG << "dump block:" << result_block.dump_data(0, 10)
460
0
                   << ", be_exec_version:" << request.be_exec_version();
461
0
        [[maybe_unused]] size_t compressed_size = 0;
462
0
        [[maybe_unused]] size_t uncompressed_size = 0;
463
0
        int be_exec_version = request.has_be_exec_version() ? request.be_exec_version() : 0;
464
0
        RETURN_IF_ERROR(result_block.serialize(be_exec_version, response->mutable_block(),
465
0
                                               &uncompressed_size, &compressed_size,
466
0
                                               segment_v2::CompressionTypePB::LZ4));
467
0
    }
468
469
0
    LOG(INFO) << "Query stats: "
470
0
              << fmt::format(
471
0
                         "hit_cached_pages:{}, total_pages_read:{}, compressed_bytes_read:{}, "
472
0
                         "io_latency:{}ns, "
473
0
                         "uncompressed_bytes_read:{},"
474
0
                         "bytes_read:{},"
475
0
                         "acquire_tablet_ms:{}, acquire_rowsets_ms:{}, acquire_segments_ms:{}, "
476
0
                         "lookup_row_data_ms:{}",
477
0
                         stats.cached_pages_num, stats.total_pages_num, stats.compressed_bytes_read,
478
0
                         stats.io_ns, stats.uncompressed_bytes_read, stats.bytes_read,
479
0
                         acquire_tablet_ms, acquire_rowsets_ms, acquire_segments_ms,
480
0
                         lookup_row_data_ms);
481
0
    return Status::OK();
482
0
}
483
484
} // namespace doris