Coverage Report

Created: 2026-10-27 15:35

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/storage/segment/binary_plain_page.h
Line
Count
Source
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
// Simplistic page encoding for strings.
19
//
20
// The page consists of:
21
// Strings:
22
//   raw strings that were written
23
// Trailer
24
//  Offsets:
25
//    offsets pointing to the beginning of each string
26
//  num_elems (32-bit fixed)
27
//
28
29
#pragma once
30
31
#include "common/logging.h"
32
#include "core/column/column_complex.h"
33
#include "storage/olap_common.h"
34
#include "storage/segment/options.h"
35
#include "storage/segment/page_builder.h"
36
#include "storage/segment/page_decoder.h"
37
#include "storage/types.h"
38
#include "util/coding.h"
39
#include "util/faststring.h"
40
41
namespace doris {
42
namespace segment_v2 {
43
44
template <FieldType Type>
45
class BinaryPlainPageBuilder : public PageBuilderHelper<BinaryPlainPageBuilder<Type>> {
46
public:
47
    using Self = BinaryPlainPageBuilder<Type>;
48
    friend class PageBuilderHelper<Self>;
49
50
25.2k
    Status init() override { return reset(); }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE4initEv
Line
Count
Source
50
7.08k
    Status init() override { return reset(); }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE4initEv
Line
Count
Source
50
9
    Status init() override { return reset(); }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE4initEv
Line
Count
Source
50
106
    Status init() override { return reset(); }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE4initEv
Line
Count
Source
50
56
    Status init() override { return reset(); }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE4initEv
Line
Count
Source
50
17.9k
    Status init() override { return reset(); }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE4initEv
Line
Count
Source
50
3
    Status init() override { return reset(); }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE4initEv
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE4initEv
Line
Count
Source
50
18
    Status init() override { return reset(); }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE4initEv
Line
Count
Source
50
18
    Status init() override { return reset(); }
51
52
1.81M
    bool is_page_full() override {
53
1.81M
        bool ret = false;
54
1.81M
        if (_options.is_dict_page) {
55
            // dict_page_size is 0, do not limit the page size
56
1.37M
            ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size;
57
1.37M
        } else {
58
439k
            ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size;
59
439k
        }
60
1.81M
        return ret;
61
1.81M
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE12is_page_fullEv
Line
Count
Source
52
1.72M
    bool is_page_full() override {
53
1.72M
        bool ret = false;
54
1.72M
        if (_options.is_dict_page) {
55
            // dict_page_size is 0, do not limit the page size
56
1.37M
            ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size;
57
1.37M
        } else {
58
353k
            ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size;
59
353k
        }
60
1.72M
        return ret;
61
1.72M
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE12is_page_fullEv
Line
Count
Source
52
6.97k
    bool is_page_full() override {
53
6.97k
        bool ret = false;
54
6.97k
        if (_options.is_dict_page) {
55
            // dict_page_size is 0, do not limit the page size
56
0
            ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size;
57
6.97k
        } else {
58
6.97k
            ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size;
59
6.97k
        }
60
6.97k
        return ret;
61
6.97k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE12is_page_fullEv
Line
Count
Source
52
4.06k
    bool is_page_full() override {
53
4.06k
        bool ret = false;
54
4.06k
        if (_options.is_dict_page) {
55
            // dict_page_size is 0, do not limit the page size
56
0
            ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size;
57
4.06k
        } else {
58
4.06k
            ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size;
59
4.06k
        }
60
4.06k
        return ret;
61
4.06k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE12is_page_fullEv
Line
Count
Source
52
6.71k
    bool is_page_full() override {
53
6.71k
        bool ret = false;
54
6.71k
        if (_options.is_dict_page) {
55
            // dict_page_size is 0, do not limit the page size
56
0
            ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size;
57
6.71k
        } else {
58
6.71k
            ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size;
59
6.71k
        }
60
6.71k
        return ret;
61
6.71k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE12is_page_fullEv
Line
Count
Source
52
67.0k
    bool is_page_full() override {
53
67.0k
        bool ret = false;
54
67.0k
        if (_options.is_dict_page) {
55
            // dict_page_size is 0, do not limit the page size
56
0
            ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size;
57
67.0k
        } else {
58
67.0k
            ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size;
59
67.0k
        }
60
67.0k
        return ret;
61
67.0k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE12is_page_fullEv
Line
Count
Source
52
561
    bool is_page_full() override {
53
561
        bool ret = false;
54
561
        if (_options.is_dict_page) {
55
            // dict_page_size is 0, do not limit the page size
56
0
            ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size;
57
561
        } else {
58
561
            ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size;
59
561
        }
60
561
        return ret;
61
561
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE12is_page_fullEv
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE12is_page_fullEv
Line
Count
Source
52
192
    bool is_page_full() override {
53
192
        bool ret = false;
54
192
        if (_options.is_dict_page) {
55
            // dict_page_size is 0, do not limit the page size
56
0
            ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size;
57
192
        } else {
58
192
            ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size;
59
192
        }
60
192
        return ret;
61
192
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE12is_page_fullEv
Line
Count
Source
52
356
    bool is_page_full() override {
53
356
        bool ret = false;
54
356
        if (_options.is_dict_page) {
55
            // dict_page_size is 0, do not limit the page size
56
0
            ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size;
57
356
        } else {
58
356
            ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size;
59
356
        }
60
356
        return ret;
61
356
    }
62
63
248k
    Status add(const uint8_t* vals, size_t* count) override {
64
248k
        DCHECK(!_finished);
65
248k
        DCHECK_GT(*count, 0);
66
248k
        size_t i = 0;
67
68
        // If the page is full, should stop adding more items.
69
549k
        while (!is_page_full() && i < *count) {
70
300k
            const auto* src = reinterpret_cast<const Slice*>(vals);
71
300k
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
72
22.4k
                if (_options.need_check_bitmap) {
73
265
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data)));
74
265
                }
75
22.4k
            }
76
22.4k
            size_t offset = _buffer.size();
77
300k
            _offsets.push_back(cast_set<uint32_t>(offset));
78
            // This may need a large memory, should return error if could not allocated
79
            // successfully, to avoid BE OOM.
80
300k
            RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size));
81
82
300k
            _last_value_size = cast_set<uint32_t>(src->size);
83
300k
            _size_estimate += src->size;
84
300k
            _size_estimate += sizeof(uint32_t);
85
300k
            _raw_data_size += src->size;
86
87
300k
            i++;
88
300k
            vals += sizeof(Slice);
89
300k
        }
90
91
248k
        *count = i;
92
248k
        return Status::OK();
93
248k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE3addEPKhPm
Line
Count
Source
63
223k
    Status add(const uint8_t* vals, size_t* count) override {
64
223k
        DCHECK(!_finished);
65
223k
        DCHECK_GT(*count, 0);
66
223k
        size_t i = 0;
67
68
        // If the page is full, should stop adding more items.
69
487k
        while (!is_page_full() && i < *count) {
70
264k
            const auto* src = reinterpret_cast<const Slice*>(vals);
71
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
72
                if (_options.need_check_bitmap) {
73
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data)));
74
                }
75
            }
76
264k
            size_t offset = _buffer.size();
77
264k
            _offsets.push_back(cast_set<uint32_t>(offset));
78
            // This may need a large memory, should return error if could not allocated
79
            // successfully, to avoid BE OOM.
80
264k
            RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size));
81
82
264k
            _last_value_size = cast_set<uint32_t>(src->size);
83
264k
            _size_estimate += src->size;
84
264k
            _size_estimate += sizeof(uint32_t);
85
264k
            _raw_data_size += src->size;
86
87
264k
            i++;
88
264k
            vals += sizeof(Slice);
89
264k
        }
90
91
223k
        *count = i;
92
223k
        return Status::OK();
93
223k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE3addEPKhPm
Line
Count
Source
63
712
    Status add(const uint8_t* vals, size_t* count) override {
64
712
        DCHECK(!_finished);
65
712
        DCHECK_GT(*count, 0);
66
712
        size_t i = 0;
67
68
        // If the page is full, should stop adding more items.
69
6.26k
        while (!is_page_full() && i < *count) {
70
5.55k
            const auto* src = reinterpret_cast<const Slice*>(vals);
71
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
72
                if (_options.need_check_bitmap) {
73
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data)));
74
                }
75
            }
76
5.55k
            size_t offset = _buffer.size();
77
5.55k
            _offsets.push_back(cast_set<uint32_t>(offset));
78
            // This may need a large memory, should return error if could not allocated
79
            // successfully, to avoid BE OOM.
80
5.55k
            RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size));
81
82
5.55k
            _last_value_size = cast_set<uint32_t>(src->size);
83
5.55k
            _size_estimate += src->size;
84
5.55k
            _size_estimate += sizeof(uint32_t);
85
5.55k
            _raw_data_size += src->size;
86
87
5.55k
            i++;
88
5.55k
            vals += sizeof(Slice);
89
5.55k
        }
90
91
712
        *count = i;
92
712
        return Status::OK();
93
712
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE3addEPKhPm
Line
Count
Source
63
1.18k
    Status add(const uint8_t* vals, size_t* count) override {
64
1.18k
        DCHECK(!_finished);
65
1.18k
        DCHECK_GT(*count, 0);
66
1.18k
        size_t i = 0;
67
68
        // If the page is full, should stop adding more items.
69
2.87k
        while (!is_page_full() && i < *count) {
70
1.69k
            const auto* src = reinterpret_cast<const Slice*>(vals);
71
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
72
                if (_options.need_check_bitmap) {
73
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data)));
74
                }
75
            }
76
1.69k
            size_t offset = _buffer.size();
77
1.69k
            _offsets.push_back(cast_set<uint32_t>(offset));
78
            // This may need a large memory, should return error if could not allocated
79
            // successfully, to avoid BE OOM.
80
1.69k
            RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size));
81
82
1.69k
            _last_value_size = cast_set<uint32_t>(src->size);
83
1.69k
            _size_estimate += src->size;
84
1.69k
            _size_estimate += sizeof(uint32_t);
85
1.69k
            _raw_data_size += src->size;
86
87
1.69k
            i++;
88
1.69k
            vals += sizeof(Slice);
89
1.69k
        }
90
91
1.18k
        *count = i;
92
1.18k
        return Status::OK();
93
1.18k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE3addEPKhPm
Line
Count
Source
63
544
    Status add(const uint8_t* vals, size_t* count) override {
64
544
        DCHECK(!_finished);
65
544
        DCHECK_GT(*count, 0);
66
544
        size_t i = 0;
67
68
        // If the page is full, should stop adding more items.
69
6.16k
        while (!is_page_full() && i < *count) {
70
5.62k
            const auto* src = reinterpret_cast<const Slice*>(vals);
71
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
72
                if (_options.need_check_bitmap) {
73
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data)));
74
                }
75
            }
76
5.62k
            size_t offset = _buffer.size();
77
5.62k
            _offsets.push_back(cast_set<uint32_t>(offset));
78
            // This may need a large memory, should return error if could not allocated
79
            // successfully, to avoid BE OOM.
80
5.62k
            RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size));
81
82
5.62k
            _last_value_size = cast_set<uint32_t>(src->size);
83
5.62k
            _size_estimate += src->size;
84
5.62k
            _size_estimate += sizeof(uint32_t);
85
5.62k
            _raw_data_size += src->size;
86
87
5.62k
            i++;
88
5.62k
            vals += sizeof(Slice);
89
5.62k
        }
90
91
544
        *count = i;
92
544
        return Status::OK();
93
544
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE3addEPKhPm
Line
Count
Source
63
22.3k
    Status add(const uint8_t* vals, size_t* count) override {
64
22.3k
        DCHECK(!_finished);
65
22.3k
        DCHECK_GT(*count, 0);
66
22.3k
        size_t i = 0;
67
68
        // If the page is full, should stop adding more items.
69
44.7k
        while (!is_page_full() && i < *count) {
70
22.4k
            const auto* src = reinterpret_cast<const Slice*>(vals);
71
22.4k
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
72
22.4k
                if (_options.need_check_bitmap) {
73
265
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data)));
74
265
                }
75
22.4k
            }
76
22.4k
            size_t offset = _buffer.size();
77
22.4k
            _offsets.push_back(cast_set<uint32_t>(offset));
78
            // This may need a large memory, should return error if could not allocated
79
            // successfully, to avoid BE OOM.
80
22.4k
            RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size));
81
82
22.4k
            _last_value_size = cast_set<uint32_t>(src->size);
83
22.4k
            _size_estimate += src->size;
84
22.4k
            _size_estimate += sizeof(uint32_t);
85
22.4k
            _raw_data_size += src->size;
86
87
22.4k
            i++;
88
22.4k
            vals += sizeof(Slice);
89
22.4k
        }
90
91
22.3k
        *count = i;
92
22.3k
        return Status::OK();
93
22.3k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE3addEPKhPm
Line
Count
Source
63
65
    Status add(const uint8_t* vals, size_t* count) override {
64
65
        DCHECK(!_finished);
65
65
        DCHECK_GT(*count, 0);
66
65
        size_t i = 0;
67
68
        // If the page is full, should stop adding more items.
69
496
        while (!is_page_full() && i < *count) {
70
431
            const auto* src = reinterpret_cast<const Slice*>(vals);
71
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
72
                if (_options.need_check_bitmap) {
73
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data)));
74
                }
75
            }
76
431
            size_t offset = _buffer.size();
77
431
            _offsets.push_back(cast_set<uint32_t>(offset));
78
            // This may need a large memory, should return error if could not allocated
79
            // successfully, to avoid BE OOM.
80
431
            RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size));
81
82
431
            _last_value_size = cast_set<uint32_t>(src->size);
83
431
            _size_estimate += src->size;
84
431
            _size_estimate += sizeof(uint32_t);
85
431
            _raw_data_size += src->size;
86
87
431
            i++;
88
431
            vals += sizeof(Slice);
89
431
        }
90
91
65
        *count = i;
92
65
        return Status::OK();
93
65
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE3addEPKhPm
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE3addEPKhPm
Line
Count
Source
63
32
    Status add(const uint8_t* vals, size_t* count) override {
64
32
        DCHECK(!_finished);
65
32
        DCHECK_GT(*count, 0);
66
32
        size_t i = 0;
67
68
        // If the page is full, should stop adding more items.
69
160
        while (!is_page_full() && i < *count) {
70
128
            const auto* src = reinterpret_cast<const Slice*>(vals);
71
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
72
                if (_options.need_check_bitmap) {
73
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data)));
74
                }
75
            }
76
128
            size_t offset = _buffer.size();
77
128
            _offsets.push_back(cast_set<uint32_t>(offset));
78
            // This may need a large memory, should return error if could not allocated
79
            // successfully, to avoid BE OOM.
80
128
            RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size));
81
82
128
            _last_value_size = cast_set<uint32_t>(src->size);
83
128
            _size_estimate += src->size;
84
128
            _size_estimate += sizeof(uint32_t);
85
128
            _raw_data_size += src->size;
86
87
128
            i++;
88
128
            vals += sizeof(Slice);
89
128
        }
90
91
32
        *count = i;
92
32
        return Status::OK();
93
32
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE3addEPKhPm
Line
Count
Source
63
34
    Status add(const uint8_t* vals, size_t* count) override {
64
34
        DCHECK(!_finished);
65
34
        DCHECK_GT(*count, 0);
66
34
        size_t i = 0;
67
68
        // If the page is full, should stop adding more items.
69
322
        while (!is_page_full() && i < *count) {
70
288
            const auto* src = reinterpret_cast<const Slice*>(vals);
71
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
72
                if (_options.need_check_bitmap) {
73
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data)));
74
                }
75
            }
76
288
            size_t offset = _buffer.size();
77
288
            _offsets.push_back(cast_set<uint32_t>(offset));
78
            // This may need a large memory, should return error if could not allocated
79
            // successfully, to avoid BE OOM.
80
288
            RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size));
81
82
288
            _last_value_size = cast_set<uint32_t>(src->size);
83
288
            _size_estimate += src->size;
84
288
            _size_estimate += sizeof(uint32_t);
85
288
            _raw_data_size += src->size;
86
87
288
            i++;
88
288
            vals += sizeof(Slice);
89
288
        }
90
91
34
        *count = i;
92
34
        return Status::OK();
93
34
    }
94
95
28.5k
    Status finish(OwnedSlice* slice) override {
96
28.5k
        DCHECK(!_finished);
97
28.5k
        _finished = true;
98
28.5k
        RETURN_IF_CATCH_EXCEPTION({
99
            // Set up trailer
100
28.5k
            for (uint32_t _offset : _offsets) {
101
28.5k
                put_fixed32_le(&_buffer, _offset);
102
28.5k
            }
103
28.5k
            put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size()));
104
28.5k
            *slice = _buffer.build();
105
28.5k
        });
106
28.5k
        return Status::OK();
107
28.5k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE6finishEPNS_10OwnedSliceE
Line
Count
Source
95
9.10k
    Status finish(OwnedSlice* slice) override {
96
9.10k
        DCHECK(!_finished);
97
9.10k
        _finished = true;
98
9.10k
        RETURN_IF_CATCH_EXCEPTION({
99
            // Set up trailer
100
9.10k
            for (uint32_t _offset : _offsets) {
101
9.10k
                put_fixed32_le(&_buffer, _offset);
102
9.10k
            }
103
9.10k
            put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size()));
104
9.10k
            *slice = _buffer.build();
105
9.10k
        });
106
9.10k
        return Status::OK();
107
9.10k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE6finishEPNS_10OwnedSliceE
Line
Count
Source
95
661
    Status finish(OwnedSlice* slice) override {
96
661
        DCHECK(!_finished);
97
661
        _finished = true;
98
661
        RETURN_IF_CATCH_EXCEPTION({
99
            // Set up trailer
100
661
            for (uint32_t _offset : _offsets) {
101
661
                put_fixed32_le(&_buffer, _offset);
102
661
            }
103
661
            put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size()));
104
661
            *slice = _buffer.build();
105
661
        });
106
661
        return Status::OK();
107
661
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE6finishEPNS_10OwnedSliceE
Line
Count
Source
95
229
    Status finish(OwnedSlice* slice) override {
96
229
        DCHECK(!_finished);
97
229
        _finished = true;
98
229
        RETURN_IF_CATCH_EXCEPTION({
99
            // Set up trailer
100
229
            for (uint32_t _offset : _offsets) {
101
229
                put_fixed32_le(&_buffer, _offset);
102
229
            }
103
229
            put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size()));
104
229
            *slice = _buffer.build();
105
229
        });
106
229
        return Status::OK();
107
229
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE6finishEPNS_10OwnedSliceE
Line
Count
Source
95
530
    Status finish(OwnedSlice* slice) override {
96
530
        DCHECK(!_finished);
97
530
        _finished = true;
98
530
        RETURN_IF_CATCH_EXCEPTION({
99
            // Set up trailer
100
530
            for (uint32_t _offset : _offsets) {
101
530
                put_fixed32_le(&_buffer, _offset);
102
530
            }
103
530
            put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size()));
104
530
            *slice = _buffer.build();
105
530
        });
106
530
        return Status::OK();
107
530
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE6finishEPNS_10OwnedSliceE
Line
Count
Source
95
17.9k
    Status finish(OwnedSlice* slice) override {
96
17.9k
        DCHECK(!_finished);
97
17.9k
        _finished = true;
98
17.9k
        RETURN_IF_CATCH_EXCEPTION({
99
            // Set up trailer
100
17.9k
            for (uint32_t _offset : _offsets) {
101
17.9k
                put_fixed32_le(&_buffer, _offset);
102
17.9k
            }
103
17.9k
            put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size()));
104
17.9k
            *slice = _buffer.build();
105
17.9k
        });
106
17.9k
        return Status::OK();
107
17.9k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE6finishEPNS_10OwnedSliceE
Line
Count
Source
95
19
    Status finish(OwnedSlice* slice) override {
96
19
        DCHECK(!_finished);
97
19
        _finished = true;
98
19
        RETURN_IF_CATCH_EXCEPTION({
99
            // Set up trailer
100
19
            for (uint32_t _offset : _offsets) {
101
19
                put_fixed32_le(&_buffer, _offset);
102
19
            }
103
19
            put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size()));
104
19
            *slice = _buffer.build();
105
19
        });
106
19
        return Status::OK();
107
19
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE6finishEPNS_10OwnedSliceE
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE6finishEPNS_10OwnedSliceE
Line
Count
Source
95
28
    Status finish(OwnedSlice* slice) override {
96
28
        DCHECK(!_finished);
97
28
        _finished = true;
98
28
        RETURN_IF_CATCH_EXCEPTION({
99
            // Set up trailer
100
28
            for (uint32_t _offset : _offsets) {
101
28
                put_fixed32_le(&_buffer, _offset);
102
28
            }
103
28
            put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size()));
104
28
            *slice = _buffer.build();
105
28
        });
106
28
        return Status::OK();
107
28
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE6finishEPNS_10OwnedSliceE
Line
Count
Source
95
28
    Status finish(OwnedSlice* slice) override {
96
28
        DCHECK(!_finished);
97
28
        _finished = true;
98
28
        RETURN_IF_CATCH_EXCEPTION({
99
            // Set up trailer
100
28
            for (uint32_t _offset : _offsets) {
101
28
                put_fixed32_le(&_buffer, _offset);
102
28
            }
103
28
            put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size()));
104
28
            *slice = _buffer.build();
105
28
        });
106
28
        return Status::OK();
107
28
    }
108
109
49.0k
    Status reset() override {
110
49.0k
        RETURN_IF_CATCH_EXCEPTION({
111
49.0k
            _offsets.clear();
112
49.0k
            _buffer.clear();
113
49.0k
            _buffer.reserve(_options.data_page_size == 0
114
49.0k
                                    ? 1024
115
49.0k
                                    : std::min(_options.data_page_size, _options.dict_page_size));
116
49.0k
            _size_estimate = sizeof(uint32_t);
117
49.0k
            _finished = false;
118
49.0k
            _last_value_size = 0;
119
49.0k
            _raw_data_size = 0;
120
49.0k
        });
121
49.0k
        return Status::OK();
122
49.0k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE5resetEv
Line
Count
Source
109
11.3k
    Status reset() override {
110
11.3k
        RETURN_IF_CATCH_EXCEPTION({
111
11.3k
            _offsets.clear();
112
11.3k
            _buffer.clear();
113
11.3k
            _buffer.reserve(_options.data_page_size == 0
114
11.3k
                                    ? 1024
115
11.3k
                                    : std::min(_options.data_page_size, _options.dict_page_size));
116
11.3k
            _size_estimate = sizeof(uint32_t);
117
11.3k
            _finished = false;
118
11.3k
            _last_value_size = 0;
119
11.3k
            _raw_data_size = 0;
120
11.3k
        });
121
11.3k
        return Status::OK();
122
11.3k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE5resetEv
Line
Count
Source
109
669
    Status reset() override {
110
669
        RETURN_IF_CATCH_EXCEPTION({
111
669
            _offsets.clear();
112
669
            _buffer.clear();
113
669
            _buffer.reserve(_options.data_page_size == 0
114
669
                                    ? 1024
115
669
                                    : std::min(_options.data_page_size, _options.dict_page_size));
116
669
            _size_estimate = sizeof(uint32_t);
117
669
            _finished = false;
118
669
            _last_value_size = 0;
119
669
            _raw_data_size = 0;
120
669
        });
121
669
        return Status::OK();
122
669
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE5resetEv
Line
Count
Source
109
335
    Status reset() override {
110
335
        RETURN_IF_CATCH_EXCEPTION({
111
335
            _offsets.clear();
112
335
            _buffer.clear();
113
335
            _buffer.reserve(_options.data_page_size == 0
114
335
                                    ? 1024
115
335
                                    : std::min(_options.data_page_size, _options.dict_page_size));
116
335
            _size_estimate = sizeof(uint32_t);
117
335
            _finished = false;
118
335
            _last_value_size = 0;
119
335
            _raw_data_size = 0;
120
335
        });
121
335
        return Status::OK();
122
335
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE5resetEv
Line
Count
Source
109
586
    Status reset() override {
110
586
        RETURN_IF_CATCH_EXCEPTION({
111
586
            _offsets.clear();
112
586
            _buffer.clear();
113
586
            _buffer.reserve(_options.data_page_size == 0
114
586
                                    ? 1024
115
586
                                    : std::min(_options.data_page_size, _options.dict_page_size));
116
586
            _size_estimate = sizeof(uint32_t);
117
586
            _finished = false;
118
586
            _last_value_size = 0;
119
586
            _raw_data_size = 0;
120
586
        });
121
586
        return Status::OK();
122
586
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE5resetEv
Line
Count
Source
109
35.9k
    Status reset() override {
110
35.9k
        RETURN_IF_CATCH_EXCEPTION({
111
35.9k
            _offsets.clear();
112
35.9k
            _buffer.clear();
113
35.9k
            _buffer.reserve(_options.data_page_size == 0
114
35.9k
                                    ? 1024
115
35.9k
                                    : std::min(_options.data_page_size, _options.dict_page_size));
116
35.9k
            _size_estimate = sizeof(uint32_t);
117
35.9k
            _finished = false;
118
35.9k
            _last_value_size = 0;
119
35.9k
            _raw_data_size = 0;
120
35.9k
        });
121
35.9k
        return Status::OK();
122
35.9k
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE5resetEv
Line
Count
Source
109
22
    Status reset() override {
110
22
        RETURN_IF_CATCH_EXCEPTION({
111
22
            _offsets.clear();
112
22
            _buffer.clear();
113
22
            _buffer.reserve(_options.data_page_size == 0
114
22
                                    ? 1024
115
22
                                    : std::min(_options.data_page_size, _options.dict_page_size));
116
22
            _size_estimate = sizeof(uint32_t);
117
22
            _finished = false;
118
22
            _last_value_size = 0;
119
22
            _raw_data_size = 0;
120
22
        });
121
22
        return Status::OK();
122
22
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE5resetEv
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE5resetEv
Line
Count
Source
109
46
    Status reset() override {
110
46
        RETURN_IF_CATCH_EXCEPTION({
111
46
            _offsets.clear();
112
46
            _buffer.clear();
113
46
            _buffer.reserve(_options.data_page_size == 0
114
46
                                    ? 1024
115
46
                                    : std::min(_options.data_page_size, _options.dict_page_size));
116
46
            _size_estimate = sizeof(uint32_t);
117
46
            _finished = false;
118
46
            _last_value_size = 0;
119
46
            _raw_data_size = 0;
120
46
        });
121
46
        return Status::OK();
122
46
    }
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE5resetEv
Line
Count
Source
109
46
    Status reset() override {
110
46
        RETURN_IF_CATCH_EXCEPTION({
111
46
            _offsets.clear();
112
46
            _buffer.clear();
113
46
            _buffer.reserve(_options.data_page_size == 0
114
46
                                    ? 1024
115
46
                                    : std::min(_options.data_page_size, _options.dict_page_size));
116
46
            _size_estimate = sizeof(uint32_t);
117
46
            _finished = false;
118
46
            _last_value_size = 0;
119
46
            _raw_data_size = 0;
120
46
        });
121
46
        return Status::OK();
122
46
    }
123
124
18.8k
    size_t count() const override { return _offsets.size(); }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE5countEv
Line
Count
Source
124
586
    size_t count() const override { return _offsets.size(); }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE5countEv
Line
Count
Source
124
9
    size_t count() const override { return _offsets.size(); }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE5countEv
Line
Count
Source
124
58
    size_t count() const override { return _offsets.size(); }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE5countEv
Line
Count
Source
124
229
    size_t count() const override { return _offsets.size(); }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE5countEv
Line
Count
Source
124
17.9k
    size_t count() const override { return _offsets.size(); }
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE5countEv
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE5countEv
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE5countEv
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE5countEv
125
126
1.72k
    uint64_t size() const override { return _size_estimate; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE4sizeEv
Line
Count
Source
126
1.56k
    uint64_t size() const override { return _size_estimate; }
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE4sizeEv
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE4sizeEv
Line
Count
Source
126
72
    uint64_t size() const override { return _size_estimate; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE4sizeEv
Line
Count
Source
126
24
    uint64_t size() const override { return _size_estimate; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE4sizeEv
Line
Count
Source
126
53
    uint64_t size() const override { return _size_estimate; }
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE4sizeEv
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE4sizeEv
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE4sizeEv
Line
Count
Source
126
8
    uint64_t size() const override { return _size_estimate; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE4sizeEv
Line
Count
Source
126
8
    uint64_t size() const override { return _size_estimate; }
127
128
1.29k
    uint64_t get_raw_data_size() const override { return _raw_data_size; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE17get_raw_data_sizeEv
Line
Count
Source
128
23
    uint64_t get_raw_data_size() const override { return _raw_data_size; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE17get_raw_data_sizeEv
Line
Count
Source
128
652
    uint64_t get_raw_data_size() const override { return _raw_data_size; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE17get_raw_data_sizeEv
Line
Count
Source
128
172
    uint64_t get_raw_data_size() const override { return _raw_data_size; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE17get_raw_data_sizeEv
Line
Count
Source
128
302
    uint64_t get_raw_data_size() const override { return _raw_data_size; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE17get_raw_data_sizeEv
Line
Count
Source
128
69
    uint64_t get_raw_data_size() const override { return _raw_data_size; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE17get_raw_data_sizeEv
Line
Count
Source
128
19
    uint64_t get_raw_data_size() const override { return _raw_data_size; }
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE17get_raw_data_sizeEv
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE17get_raw_data_sizeEv
Line
Count
Source
128
28
    uint64_t get_raw_data_size() const override { return _raw_data_size; }
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE17get_raw_data_sizeEv
Line
Count
Source
128
28
    uint64_t get_raw_data_size() const override { return _raw_data_size; }
129
130
private:
131
    BinaryPlainPageBuilder(const PageBuilderOptions& options)
132
25.2k
            : _size_estimate(0), _options(options) {}
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EEC2ERKNS0_18PageBuilderOptionsE
Line
Count
Source
132
7.08k
            : _size_estimate(0), _options(options) {}
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EEC2ERKNS0_18PageBuilderOptionsE
Line
Count
Source
132
9
            : _size_estimate(0), _options(options) {}
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EEC2ERKNS0_18PageBuilderOptionsE
Line
Count
Source
132
106
            : _size_estimate(0), _options(options) {}
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EEC2ERKNS0_18PageBuilderOptionsE
Line
Count
Source
132
56
            : _size_estimate(0), _options(options) {}
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EEC2ERKNS0_18PageBuilderOptionsE
Line
Count
Source
132
17.9k
            : _size_estimate(0), _options(options) {}
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EEC2ERKNS0_18PageBuilderOptionsE
Line
Count
Source
132
3
            : _size_estimate(0), _options(options) {}
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EEC2ERKNS0_18PageBuilderOptionsE
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EEC2ERKNS0_18PageBuilderOptionsE
Line
Count
Source
132
18
            : _size_estimate(0), _options(options) {}
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EEC2ERKNS0_18PageBuilderOptionsE
Line
Count
Source
132
18
            : _size_estimate(0), _options(options) {}
133
134
    faststring _buffer;
135
    size_t _size_estimate;
136
    // Offsets of each entry, relative to the start of the page
137
    std::vector<uint32_t> _offsets;
138
    bool _finished;
139
    PageBuilderOptions _options;
140
    // size of last added value
141
    uint32_t _last_value_size = 0;
142
    uint64_t _raw_data_size = 0;
143
};
144
145
template <FieldType Type>
146
class BinaryPlainPageDecoder : public PageDecoder {
147
public:
148
    BinaryPlainPageDecoder(Slice data) : BinaryPlainPageDecoder(data, PageDecoderOptions()) {}
149
150
    BinaryPlainPageDecoder(Slice data, const PageDecoderOptions& options)
151
6.78k
            : _data(data),
152
6.78k
              _options(options),
153
6.78k
              _parsed(false),
154
6.78k
              _num_elems(0),
155
6.78k
              _offsets_pos(0),
156
6.78k
              _cur_idx(0) {}
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE
Line
Count
Source
151
3.03k
            : _data(data),
152
3.03k
              _options(options),
153
3.03k
              _parsed(false),
154
3.03k
              _num_elems(0),
155
3.03k
              _offsets_pos(0),
156
3.03k
              _cur_idx(0) {}
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE
Line
Count
Source
151
3.19k
            : _data(data),
152
3.19k
              _options(options),
153
3.19k
              _parsed(false),
154
3.19k
              _num_elems(0),
155
3.19k
              _offsets_pos(0),
156
3.19k
              _cur_idx(0) {}
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE
Line
Count
Source
151
60
            : _data(data),
152
60
              _options(options),
153
60
              _parsed(false),
154
60
              _num_elems(0),
155
60
              _offsets_pos(0),
156
60
              _cur_idx(0) {}
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE
Line
Count
Source
151
38
            : _data(data),
152
38
              _options(options),
153
38
              _parsed(false),
154
38
              _num_elems(0),
155
38
              _offsets_pos(0),
156
38
              _cur_idx(0) {}
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE
Line
Count
Source
151
46
            : _data(data),
152
46
              _options(options),
153
46
              _parsed(false),
154
46
              _num_elems(0),
155
46
              _offsets_pos(0),
156
46
              _cur_idx(0) {}
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE
Line
Count
Source
151
263
            : _data(data),
152
263
              _options(options),
153
263
              _parsed(false),
154
263
              _num_elems(0),
155
263
              _offsets_pos(0),
156
263
              _cur_idx(0) {}
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE
Line
Count
Source
151
18
            : _data(data),
152
18
              _options(options),
153
18
              _parsed(false),
154
18
              _num_elems(0),
155
18
              _offsets_pos(0),
156
18
              _cur_idx(0) {}
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE
Line
Count
Source
151
114
            : _data(data),
152
114
              _options(options),
153
114
              _parsed(false),
154
114
              _num_elems(0),
155
114
              _offsets_pos(0),
156
114
              _cur_idx(0) {}
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE
Line
Count
Source
151
16
            : _data(data),
152
16
              _options(options),
153
16
              _parsed(false),
154
16
              _num_elems(0),
155
16
              _offsets_pos(0),
156
16
              _cur_idx(0) {}
157
158
6.78k
    Status init() override {
159
6.78k
        CHECK(!_parsed);
160
161
6.78k
        if (_data.size < sizeof(uint32_t)) {
162
0
            return Status::Corruption(
163
0
                    "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ."
164
0
                    "invalid data size:{}, trailer size:{}",
165
0
                    _data.size, sizeof(uint32_t));
166
0
        }
167
168
        // Decode trailer
169
6.78k
        _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]);
170
6.78k
        _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t)));
171
172
6.78k
        if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) {
173
0
            return Status::Corruption(
174
0
                    "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
175
0
                    ", offset_pos: {}",
176
0
                    _data.size, _num_elems, _offsets_pos);
177
0
        }
178
6.78k
        _parsed = true;
179
180
6.78k
        return Status::OK();
181
6.78k
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE4initEv
Line
Count
Source
158
3.03k
    Status init() override {
159
3.03k
        CHECK(!_parsed);
160
161
3.03k
        if (_data.size < sizeof(uint32_t)) {
162
0
            return Status::Corruption(
163
0
                    "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ."
164
0
                    "invalid data size:{}, trailer size:{}",
165
0
                    _data.size, sizeof(uint32_t));
166
0
        }
167
168
        // Decode trailer
169
3.03k
        _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]);
170
3.03k
        _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t)));
171
172
3.03k
        if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) {
173
0
            return Status::Corruption(
174
0
                    "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
175
0
                    ", offset_pos: {}",
176
0
                    _data.size, _num_elems, _offsets_pos);
177
0
        }
178
3.03k
        _parsed = true;
179
180
3.03k
        return Status::OK();
181
3.03k
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE4initEv
Line
Count
Source
158
3.19k
    Status init() override {
159
3.19k
        CHECK(!_parsed);
160
161
3.19k
        if (_data.size < sizeof(uint32_t)) {
162
0
            return Status::Corruption(
163
0
                    "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ."
164
0
                    "invalid data size:{}, trailer size:{}",
165
0
                    _data.size, sizeof(uint32_t));
166
0
        }
167
168
        // Decode trailer
169
3.19k
        _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]);
170
3.19k
        _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t)));
171
172
3.19k
        if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) {
173
0
            return Status::Corruption(
174
0
                    "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
175
0
                    ", offset_pos: {}",
176
0
                    _data.size, _num_elems, _offsets_pos);
177
0
        }
178
3.19k
        _parsed = true;
179
180
3.19k
        return Status::OK();
181
3.19k
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE4initEv
Line
Count
Source
158
60
    Status init() override {
159
60
        CHECK(!_parsed);
160
161
60
        if (_data.size < sizeof(uint32_t)) {
162
0
            return Status::Corruption(
163
0
                    "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ."
164
0
                    "invalid data size:{}, trailer size:{}",
165
0
                    _data.size, sizeof(uint32_t));
166
0
        }
167
168
        // Decode trailer
169
60
        _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]);
170
60
        _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t)));
171
172
60
        if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) {
173
0
            return Status::Corruption(
174
0
                    "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
175
0
                    ", offset_pos: {}",
176
0
                    _data.size, _num_elems, _offsets_pos);
177
0
        }
178
60
        _parsed = true;
179
180
60
        return Status::OK();
181
60
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE4initEv
Line
Count
Source
158
38
    Status init() override {
159
38
        CHECK(!_parsed);
160
161
38
        if (_data.size < sizeof(uint32_t)) {
162
0
            return Status::Corruption(
163
0
                    "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ."
164
0
                    "invalid data size:{}, trailer size:{}",
165
0
                    _data.size, sizeof(uint32_t));
166
0
        }
167
168
        // Decode trailer
169
38
        _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]);
170
38
        _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t)));
171
172
38
        if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) {
173
0
            return Status::Corruption(
174
0
                    "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
175
0
                    ", offset_pos: {}",
176
0
                    _data.size, _num_elems, _offsets_pos);
177
0
        }
178
38
        _parsed = true;
179
180
38
        return Status::OK();
181
38
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE4initEv
Line
Count
Source
158
46
    Status init() override {
159
46
        CHECK(!_parsed);
160
161
46
        if (_data.size < sizeof(uint32_t)) {
162
0
            return Status::Corruption(
163
0
                    "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ."
164
0
                    "invalid data size:{}, trailer size:{}",
165
0
                    _data.size, sizeof(uint32_t));
166
0
        }
167
168
        // Decode trailer
169
46
        _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]);
170
46
        _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t)));
171
172
46
        if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) {
173
0
            return Status::Corruption(
174
0
                    "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
175
0
                    ", offset_pos: {}",
176
0
                    _data.size, _num_elems, _offsets_pos);
177
0
        }
178
46
        _parsed = true;
179
180
46
        return Status::OK();
181
46
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE4initEv
Line
Count
Source
158
263
    Status init() override {
159
263
        CHECK(!_parsed);
160
161
263
        if (_data.size < sizeof(uint32_t)) {
162
0
            return Status::Corruption(
163
0
                    "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ."
164
0
                    "invalid data size:{}, trailer size:{}",
165
0
                    _data.size, sizeof(uint32_t));
166
0
        }
167
168
        // Decode trailer
169
263
        _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]);
170
263
        _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t)));
171
172
263
        if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) {
173
0
            return Status::Corruption(
174
0
                    "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
175
0
                    ", offset_pos: {}",
176
0
                    _data.size, _num_elems, _offsets_pos);
177
0
        }
178
263
        _parsed = true;
179
180
263
        return Status::OK();
181
263
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE4initEv
Line
Count
Source
158
18
    Status init() override {
159
18
        CHECK(!_parsed);
160
161
18
        if (_data.size < sizeof(uint32_t)) {
162
0
            return Status::Corruption(
163
0
                    "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ."
164
0
                    "invalid data size:{}, trailer size:{}",
165
0
                    _data.size, sizeof(uint32_t));
166
0
        }
167
168
        // Decode trailer
169
18
        _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]);
170
18
        _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t)));
171
172
18
        if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) {
173
0
            return Status::Corruption(
174
0
                    "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
175
0
                    ", offset_pos: {}",
176
0
                    _data.size, _num_elems, _offsets_pos);
177
0
        }
178
18
        _parsed = true;
179
180
18
        return Status::OK();
181
18
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE4initEv
Line
Count
Source
158
114
    Status init() override {
159
114
        CHECK(!_parsed);
160
161
114
        if (_data.size < sizeof(uint32_t)) {
162
0
            return Status::Corruption(
163
0
                    "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ."
164
0
                    "invalid data size:{}, trailer size:{}",
165
0
                    _data.size, sizeof(uint32_t));
166
0
        }
167
168
        // Decode trailer
169
114
        _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]);
170
114
        _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t)));
171
172
114
        if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) {
173
0
            return Status::Corruption(
174
0
                    "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
175
0
                    ", offset_pos: {}",
176
0
                    _data.size, _num_elems, _offsets_pos);
177
0
        }
178
114
        _parsed = true;
179
180
114
        return Status::OK();
181
114
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE4initEv
Line
Count
Source
158
16
    Status init() override {
159
16
        CHECK(!_parsed);
160
161
16
        if (_data.size < sizeof(uint32_t)) {
162
0
            return Status::Corruption(
163
0
                    "file corruption: not enough bytes for trailer in BinaryPlainPageDecoder ."
164
0
                    "invalid data size:{}, trailer size:{}",
165
0
                    _data.size, sizeof(uint32_t));
166
0
        }
167
168
        // Decode trailer
169
16
        _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]);
170
16
        _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t)));
171
172
16
        if (_offsets_pos > _data.get_size() - sizeof(uint32_t)) {
173
0
            return Status::Corruption(
174
0
                    "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
175
0
                    ", offset_pos: {}",
176
0
                    _data.size, _num_elems, _offsets_pos);
177
0
        }
178
16
        _parsed = true;
179
180
16
        return Status::OK();
181
16
    }
182
183
620
    Status seek_to_position_in_page(size_t pos) override {
184
620
        if (_num_elems == 0) [[unlikely]] {
185
0
            if (pos != 0) {
186
0
                return Status::Error<ErrorCode::INTERNAL_ERROR, false>(
187
0
                        "seek pos {} is larger than total elements  {}", pos, _num_elems);
188
0
            }
189
0
        }
190
620
        DCHECK_LE(pos, _num_elems);
191
620
        _cur_idx = pos;
192
620
        return Status::OK();
193
620
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE24seek_to_position_in_pageEm
Line
Count
Source
183
455
    Status seek_to_position_in_page(size_t pos) override {
184
455
        if (_num_elems == 0) [[unlikely]] {
185
0
            if (pos != 0) {
186
0
                return Status::Error<ErrorCode::INTERNAL_ERROR, false>(
187
0
                        "seek pos {} is larger than total elements  {}", pos, _num_elems);
188
0
            }
189
0
        }
190
455
        DCHECK_LE(pos, _num_elems);
191
455
        _cur_idx = pos;
192
455
        return Status::OK();
193
455
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE24seek_to_position_in_pageEm
Line
Count
Source
183
18
    Status seek_to_position_in_page(size_t pos) override {
184
18
        if (_num_elems == 0) [[unlikely]] {
185
0
            if (pos != 0) {
186
0
                return Status::Error<ErrorCode::INTERNAL_ERROR, false>(
187
0
                        "seek pos {} is larger than total elements  {}", pos, _num_elems);
188
0
            }
189
0
        }
190
18
        DCHECK_LE(pos, _num_elems);
191
18
        _cur_idx = pos;
192
18
        return Status::OK();
193
18
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE24seek_to_position_in_pageEm
Line
Count
Source
183
4
    Status seek_to_position_in_page(size_t pos) override {
184
4
        if (_num_elems == 0) [[unlikely]] {
185
0
            if (pos != 0) {
186
0
                return Status::Error<ErrorCode::INTERNAL_ERROR, false>(
187
0
                        "seek pos {} is larger than total elements  {}", pos, _num_elems);
188
0
            }
189
0
        }
190
4
        DCHECK_LE(pos, _num_elems);
191
4
        _cur_idx = pos;
192
4
        return Status::OK();
193
4
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE24seek_to_position_in_pageEm
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE24seek_to_position_in_pageEm
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE24seek_to_position_in_pageEm
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE24seek_to_position_in_pageEm
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE24seek_to_position_in_pageEm
Line
Count
Source
183
143
    Status seek_to_position_in_page(size_t pos) override {
184
143
        if (_num_elems == 0) [[unlikely]] {
185
0
            if (pos != 0) {
186
0
                return Status::Error<ErrorCode::INTERNAL_ERROR, false>(
187
0
                        "seek pos {} is larger than total elements  {}", pos, _num_elems);
188
0
            }
189
0
        }
190
143
        DCHECK_LE(pos, _num_elems);
191
143
        _cur_idx = pos;
192
143
        return Status::OK();
193
143
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE24seek_to_position_in_pageEm
194
195
2.49k
    Status next_batch(size_t* n, MutableColumnPtr& dst) override {
196
2.49k
        DCHECK(_parsed);
197
2.49k
        if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] {
198
3
            *n = 0;
199
3
            return Status::OK();
200
3
        }
201
2.48k
        const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx));
202
203
2.48k
        if (_options.only_read_offsets) {
204
            // OFFSET_ONLY mode: read string lengths from page offset trailer
205
            // without copying actual char data. This allows length() to work.
206
0
            _offsets.resize(max_fetch);
207
0
            for (size_t i = 0; i < max_fetch; ++i) {
208
0
                uint32_t str_start = offset(_cur_idx + i);
209
0
                uint32_t str_end = offset(_cur_idx + i + 1);
210
0
                _offsets[i] = str_end - str_start;
211
0
            }
212
0
            dst->insert_offsets_from_lengths(_offsets.data(), max_fetch);
213
0
            _cur_idx += max_fetch;
214
0
            *n = max_fetch;
215
0
            return Status::OK();
216
0
        }
217
218
2.48k
        uint32_t last_offset = guarded_offset(_cur_idx);
219
2.48k
        _offsets.resize(max_fetch + 1);
220
2.48k
        _offsets[0] = last_offset;
221
460k
        for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) {
222
458k
            const uint32_t start_offset = last_offset;
223
458k
            last_offset = guarded_offset(_cur_idx + 1);
224
458k
            _offsets[i + 1] = last_offset;
225
458k
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
226
130
                if (_options.need_check_bitmap) {
227
130
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset)));
228
130
                }
229
130
            }
230
458k
        }
231
2.48k
        _cur_idx++;
232
2.48k
        _offsets[max_fetch] = offset(_cur_idx);
233
2.48k
        if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
234
162
            if (_options.need_check_bitmap) {
235
19
                RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset)));
236
19
            }
237
162
        }
238
162
        dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch);
239
240
2.48k
        *n = max_fetch;
241
2.48k
        return Status::OK();
242
2.48k
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE
Line
Count
Source
195
1.98k
    Status next_batch(size_t* n, MutableColumnPtr& dst) override {
196
1.98k
        DCHECK(_parsed);
197
1.98k
        if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] {
198
2
            *n = 0;
199
2
            return Status::OK();
200
2
        }
201
1.97k
        const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx));
202
203
1.97k
        if (_options.only_read_offsets) {
204
            // OFFSET_ONLY mode: read string lengths from page offset trailer
205
            // without copying actual char data. This allows length() to work.
206
0
            _offsets.resize(max_fetch);
207
0
            for (size_t i = 0; i < max_fetch; ++i) {
208
0
                uint32_t str_start = offset(_cur_idx + i);
209
0
                uint32_t str_end = offset(_cur_idx + i + 1);
210
0
                _offsets[i] = str_end - str_start;
211
0
            }
212
0
            dst->insert_offsets_from_lengths(_offsets.data(), max_fetch);
213
0
            _cur_idx += max_fetch;
214
0
            *n = max_fetch;
215
0
            return Status::OK();
216
0
        }
217
218
1.97k
        uint32_t last_offset = guarded_offset(_cur_idx);
219
1.97k
        _offsets.resize(max_fetch + 1);
220
1.97k
        _offsets[0] = last_offset;
221
457k
        for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) {
222
455k
            const uint32_t start_offset = last_offset;
223
455k
            last_offset = guarded_offset(_cur_idx + 1);
224
455k
            _offsets[i + 1] = last_offset;
225
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
226
                if (_options.need_check_bitmap) {
227
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset)));
228
                }
229
            }
230
455k
        }
231
1.97k
        _cur_idx++;
232
1.97k
        _offsets[max_fetch] = offset(_cur_idx);
233
        if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
234
            if (_options.need_check_bitmap) {
235
                RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset)));
236
            }
237
        }
238
1.97k
        dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch);
239
240
1.97k
        *n = max_fetch;
241
1.97k
        return Status::OK();
242
1.97k
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE
Line
Count
Source
195
103
    Status next_batch(size_t* n, MutableColumnPtr& dst) override {
196
103
        DCHECK(_parsed);
197
103
        if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] {
198
1
            *n = 0;
199
1
            return Status::OK();
200
1
        }
201
102
        const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx));
202
203
102
        if (_options.only_read_offsets) {
204
            // OFFSET_ONLY mode: read string lengths from page offset trailer
205
            // without copying actual char data. This allows length() to work.
206
0
            _offsets.resize(max_fetch);
207
0
            for (size_t i = 0; i < max_fetch; ++i) {
208
0
                uint32_t str_start = offset(_cur_idx + i);
209
0
                uint32_t str_end = offset(_cur_idx + i + 1);
210
0
                _offsets[i] = str_end - str_start;
211
0
            }
212
0
            dst->insert_offsets_from_lengths(_offsets.data(), max_fetch);
213
0
            _cur_idx += max_fetch;
214
0
            *n = max_fetch;
215
0
            return Status::OK();
216
0
        }
217
218
102
        uint32_t last_offset = guarded_offset(_cur_idx);
219
102
        _offsets.resize(max_fetch + 1);
220
102
        _offsets[0] = last_offset;
221
715
        for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) {
222
613
            const uint32_t start_offset = last_offset;
223
613
            last_offset = guarded_offset(_cur_idx + 1);
224
613
            _offsets[i + 1] = last_offset;
225
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
226
                if (_options.need_check_bitmap) {
227
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset)));
228
                }
229
            }
230
613
        }
231
102
        _cur_idx++;
232
102
        _offsets[max_fetch] = offset(_cur_idx);
233
        if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
234
            if (_options.need_check_bitmap) {
235
                RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset)));
236
            }
237
        }
238
102
        dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch);
239
240
102
        *n = max_fetch;
241
102
        return Status::OK();
242
102
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE
Line
Count
Source
195
93
    Status next_batch(size_t* n, MutableColumnPtr& dst) override {
196
93
        DCHECK(_parsed);
197
93
        if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] {
198
0
            *n = 0;
199
0
            return Status::OK();
200
0
        }
201
93
        const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx));
202
203
93
        if (_options.only_read_offsets) {
204
            // OFFSET_ONLY mode: read string lengths from page offset trailer
205
            // without copying actual char data. This allows length() to work.
206
0
            _offsets.resize(max_fetch);
207
0
            for (size_t i = 0; i < max_fetch; ++i) {
208
0
                uint32_t str_start = offset(_cur_idx + i);
209
0
                uint32_t str_end = offset(_cur_idx + i + 1);
210
0
                _offsets[i] = str_end - str_start;
211
0
            }
212
0
            dst->insert_offsets_from_lengths(_offsets.data(), max_fetch);
213
0
            _cur_idx += max_fetch;
214
0
            *n = max_fetch;
215
0
            return Status::OK();
216
0
        }
217
218
93
        uint32_t last_offset = guarded_offset(_cur_idx);
219
93
        _offsets.resize(max_fetch + 1);
220
93
        _offsets[0] = last_offset;
221
681
        for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) {
222
588
            const uint32_t start_offset = last_offset;
223
588
            last_offset = guarded_offset(_cur_idx + 1);
224
588
            _offsets[i + 1] = last_offset;
225
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
226
                if (_options.need_check_bitmap) {
227
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset)));
228
                }
229
            }
230
588
        }
231
93
        _cur_idx++;
232
93
        _offsets[max_fetch] = offset(_cur_idx);
233
        if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
234
            if (_options.need_check_bitmap) {
235
                RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset)));
236
            }
237
        }
238
93
        dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch);
239
240
93
        *n = max_fetch;
241
93
        return Status::OK();
242
93
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE
Line
Count
Source
195
38
    Status next_batch(size_t* n, MutableColumnPtr& dst) override {
196
38
        DCHECK(_parsed);
197
38
        if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] {
198
0
            *n = 0;
199
0
            return Status::OK();
200
0
        }
201
38
        const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx));
202
203
38
        if (_options.only_read_offsets) {
204
            // OFFSET_ONLY mode: read string lengths from page offset trailer
205
            // without copying actual char data. This allows length() to work.
206
0
            _offsets.resize(max_fetch);
207
0
            for (size_t i = 0; i < max_fetch; ++i) {
208
0
                uint32_t str_start = offset(_cur_idx + i);
209
0
                uint32_t str_end = offset(_cur_idx + i + 1);
210
0
                _offsets[i] = str_end - str_start;
211
0
            }
212
0
            dst->insert_offsets_from_lengths(_offsets.data(), max_fetch);
213
0
            _cur_idx += max_fetch;
214
0
            *n = max_fetch;
215
0
            return Status::OK();
216
0
        }
217
218
38
        uint32_t last_offset = guarded_offset(_cur_idx);
219
38
        _offsets.resize(max_fetch + 1);
220
38
        _offsets[0] = last_offset;
221
724
        for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) {
222
686
            const uint32_t start_offset = last_offset;
223
686
            last_offset = guarded_offset(_cur_idx + 1);
224
686
            _offsets[i + 1] = last_offset;
225
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
226
                if (_options.need_check_bitmap) {
227
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset)));
228
                }
229
            }
230
686
        }
231
38
        _cur_idx++;
232
38
        _offsets[max_fetch] = offset(_cur_idx);
233
        if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
234
            if (_options.need_check_bitmap) {
235
                RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset)));
236
            }
237
        }
238
38
        dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch);
239
240
38
        *n = max_fetch;
241
38
        return Status::OK();
242
38
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE
Line
Count
Source
195
82
    Status next_batch(size_t* n, MutableColumnPtr& dst) override {
196
82
        DCHECK(_parsed);
197
82
        if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] {
198
0
            *n = 0;
199
0
            return Status::OK();
200
0
        }
201
82
        const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx));
202
203
82
        if (_options.only_read_offsets) {
204
            // OFFSET_ONLY mode: read string lengths from page offset trailer
205
            // without copying actual char data. This allows length() to work.
206
0
            _offsets.resize(max_fetch);
207
0
            for (size_t i = 0; i < max_fetch; ++i) {
208
0
                uint32_t str_start = offset(_cur_idx + i);
209
0
                uint32_t str_end = offset(_cur_idx + i + 1);
210
0
                _offsets[i] = str_end - str_start;
211
0
            }
212
0
            dst->insert_offsets_from_lengths(_offsets.data(), max_fetch);
213
0
            _cur_idx += max_fetch;
214
0
            *n = max_fetch;
215
0
            return Status::OK();
216
0
        }
217
218
82
        uint32_t last_offset = guarded_offset(_cur_idx);
219
82
        _offsets.resize(max_fetch + 1);
220
82
        _offsets[0] = last_offset;
221
645
        for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) {
222
563
            const uint32_t start_offset = last_offset;
223
563
            last_offset = guarded_offset(_cur_idx + 1);
224
563
            _offsets[i + 1] = last_offset;
225
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
226
                if (_options.need_check_bitmap) {
227
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset)));
228
                }
229
            }
230
563
        }
231
82
        _cur_idx++;
232
82
        _offsets[max_fetch] = offset(_cur_idx);
233
        if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
234
            if (_options.need_check_bitmap) {
235
                RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset)));
236
            }
237
        }
238
82
        dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch);
239
240
82
        *n = max_fetch;
241
82
        return Status::OK();
242
82
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE
Line
Count
Source
195
18
    Status next_batch(size_t* n, MutableColumnPtr& dst) override {
196
18
        DCHECK(_parsed);
197
18
        if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] {
198
0
            *n = 0;
199
0
            return Status::OK();
200
0
        }
201
18
        const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx));
202
203
18
        if (_options.only_read_offsets) {
204
            // OFFSET_ONLY mode: read string lengths from page offset trailer
205
            // without copying actual char data. This allows length() to work.
206
0
            _offsets.resize(max_fetch);
207
0
            for (size_t i = 0; i < max_fetch; ++i) {
208
0
                uint32_t str_start = offset(_cur_idx + i);
209
0
                uint32_t str_end = offset(_cur_idx + i + 1);
210
0
                _offsets[i] = str_end - str_start;
211
0
            }
212
0
            dst->insert_offsets_from_lengths(_offsets.data(), max_fetch);
213
0
            _cur_idx += max_fetch;
214
0
            *n = max_fetch;
215
0
            return Status::OK();
216
0
        }
217
218
18
        uint32_t last_offset = guarded_offset(_cur_idx);
219
18
        _offsets.resize(max_fetch + 1);
220
18
        _offsets[0] = last_offset;
221
120
        for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) {
222
102
            const uint32_t start_offset = last_offset;
223
102
            last_offset = guarded_offset(_cur_idx + 1);
224
102
            _offsets[i + 1] = last_offset;
225
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
226
                if (_options.need_check_bitmap) {
227
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset)));
228
                }
229
            }
230
102
        }
231
18
        _cur_idx++;
232
18
        _offsets[max_fetch] = offset(_cur_idx);
233
        if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
234
            if (_options.need_check_bitmap) {
235
                RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset)));
236
            }
237
        }
238
18
        dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch);
239
240
18
        *n = max_fetch;
241
18
        return Status::OK();
242
18
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE
Line
Count
Source
195
162
    Status next_batch(size_t* n, MutableColumnPtr& dst) override {
196
162
        DCHECK(_parsed);
197
162
        if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] {
198
0
            *n = 0;
199
0
            return Status::OK();
200
0
        }
201
162
        const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx));
202
203
162
        if (_options.only_read_offsets) {
204
            // OFFSET_ONLY mode: read string lengths from page offset trailer
205
            // without copying actual char data. This allows length() to work.
206
0
            _offsets.resize(max_fetch);
207
0
            for (size_t i = 0; i < max_fetch; ++i) {
208
0
                uint32_t str_start = offset(_cur_idx + i);
209
0
                uint32_t str_end = offset(_cur_idx + i + 1);
210
0
                _offsets[i] = str_end - str_start;
211
0
            }
212
0
            dst->insert_offsets_from_lengths(_offsets.data(), max_fetch);
213
0
            _cur_idx += max_fetch;
214
0
            *n = max_fetch;
215
0
            return Status::OK();
216
0
        }
217
218
162
        uint32_t last_offset = guarded_offset(_cur_idx);
219
162
        _offsets.resize(max_fetch + 1);
220
162
        _offsets[0] = last_offset;
221
292
        for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) {
222
130
            const uint32_t start_offset = last_offset;
223
130
            last_offset = guarded_offset(_cur_idx + 1);
224
130
            _offsets[i + 1] = last_offset;
225
130
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
226
130
                if (_options.need_check_bitmap) {
227
130
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset)));
228
130
                }
229
130
            }
230
130
        }
231
162
        _cur_idx++;
232
162
        _offsets[max_fetch] = offset(_cur_idx);
233
162
        if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
234
162
            if (_options.need_check_bitmap) {
235
19
                RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset)));
236
19
            }
237
162
        }
238
162
        dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch);
239
240
162
        *n = max_fetch;
241
162
        return Status::OK();
242
162
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE
Line
Count
Source
195
16
    Status next_batch(size_t* n, MutableColumnPtr& dst) override {
196
16
        DCHECK(_parsed);
197
16
        if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] {
198
0
            *n = 0;
199
0
            return Status::OK();
200
0
        }
201
16
        const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx));
202
203
16
        if (_options.only_read_offsets) {
204
            // OFFSET_ONLY mode: read string lengths from page offset trailer
205
            // without copying actual char data. This allows length() to work.
206
0
            _offsets.resize(max_fetch);
207
0
            for (size_t i = 0; i < max_fetch; ++i) {
208
0
                uint32_t str_start = offset(_cur_idx + i);
209
0
                uint32_t str_end = offset(_cur_idx + i + 1);
210
0
                _offsets[i] = str_end - str_start;
211
0
            }
212
0
            dst->insert_offsets_from_lengths(_offsets.data(), max_fetch);
213
0
            _cur_idx += max_fetch;
214
0
            *n = max_fetch;
215
0
            return Status::OK();
216
0
        }
217
218
16
        uint32_t last_offset = guarded_offset(_cur_idx);
219
16
        _offsets.resize(max_fetch + 1);
220
16
        _offsets[0] = last_offset;
221
360
        for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) {
222
344
            const uint32_t start_offset = last_offset;
223
344
            last_offset = guarded_offset(_cur_idx + 1);
224
344
            _offsets[i + 1] = last_offset;
225
            if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
226
                if (_options.need_check_bitmap) {
227
                    RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset)));
228
                }
229
            }
230
344
        }
231
16
        _cur_idx++;
232
16
        _offsets[max_fetch] = offset(_cur_idx);
233
        if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) {
234
            if (_options.need_check_bitmap) {
235
                RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset)));
236
            }
237
        }
238
16
        dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch);
239
240
16
        *n = max_fetch;
241
16
        return Status::OK();
242
16
    }
243
244
    Status read_by_rowids(const rowid_t* rowids, ordinal_t page_first_ordinal, size_t* n,
245
605
                          MutableColumnPtr& dst) override {
246
605
        DCHECK(_parsed);
247
605
        if (*n == 0) [[unlikely]] {
248
0
            *n = 0;
249
0
            return Status::OK();
250
0
        }
251
252
605
        auto total = *n;
253
254
605
        if (_options.only_read_offsets) {
255
            // OFFSET_ONLY mode: read string lengths from page offset trailer
256
            // without copying actual char data. This allows length() to work.
257
0
            size_t read_count = 0;
258
0
            _offsets.resize(total);
259
0
            for (size_t i = 0; i < total; ++i) {
260
0
                ordinal_t ord = rowids[i] - page_first_ordinal;
261
0
                if (UNLIKELY(ord >= _num_elems)) {
262
0
                    break;
263
0
                }
264
0
                uint32_t str_start = offset(ord);
265
0
                uint32_t str_end = offset(ord + 1);
266
0
                _offsets[read_count] = str_end - str_start;
267
0
                read_count++;
268
0
            }
269
0
            if (read_count > 0) {
270
0
                dst->insert_offsets_from_lengths(_offsets.data(), read_count);
271
0
            }
272
0
            *n = read_count;
273
0
            return Status::OK();
274
0
        }
275
276
605
        size_t read_count = 0;
277
605
        _binary_data.resize(total);
278
2.62k
        for (size_t i = 0; i < total; ++i) {
279
2.01k
            ordinal_t ord = rowids[i] - page_first_ordinal;
280
2.01k
            if (UNLIKELY(ord >= _num_elems)) {
281
0
                break;
282
0
            }
283
284
2.01k
            const uint32_t start_offset = offset(ord);
285
2.01k
            _binary_data[read_count].data = _data.mutable_data() + start_offset;
286
2.01k
            _binary_data[read_count].size = offset(ord + 1) - start_offset;
287
2.01k
            read_count++;
288
2.01k
        }
289
290
605
        if (LIKELY(read_count > 0)) {
291
605
            dst->insert_many_strings(_binary_data.data(), read_count);
292
605
        }
293
294
605
        *n = read_count;
295
605
        return Status::OK();
296
605
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE
Line
Count
Source
245
556
                          MutableColumnPtr& dst) override {
246
556
        DCHECK(_parsed);
247
556
        if (*n == 0) [[unlikely]] {
248
0
            *n = 0;
249
0
            return Status::OK();
250
0
        }
251
252
556
        auto total = *n;
253
254
556
        if (_options.only_read_offsets) {
255
            // OFFSET_ONLY mode: read string lengths from page offset trailer
256
            // without copying actual char data. This allows length() to work.
257
0
            size_t read_count = 0;
258
0
            _offsets.resize(total);
259
0
            for (size_t i = 0; i < total; ++i) {
260
0
                ordinal_t ord = rowids[i] - page_first_ordinal;
261
0
                if (UNLIKELY(ord >= _num_elems)) {
262
0
                    break;
263
0
                }
264
0
                uint32_t str_start = offset(ord);
265
0
                uint32_t str_end = offset(ord + 1);
266
0
                _offsets[read_count] = str_end - str_start;
267
0
                read_count++;
268
0
            }
269
0
            if (read_count > 0) {
270
0
                dst->insert_offsets_from_lengths(_offsets.data(), read_count);
271
0
            }
272
0
            *n = read_count;
273
0
            return Status::OK();
274
0
        }
275
276
556
        size_t read_count = 0;
277
556
        _binary_data.resize(total);
278
2.50k
        for (size_t i = 0; i < total; ++i) {
279
1.95k
            ordinal_t ord = rowids[i] - page_first_ordinal;
280
1.95k
            if (UNLIKELY(ord >= _num_elems)) {
281
0
                break;
282
0
            }
283
284
1.95k
            const uint32_t start_offset = offset(ord);
285
1.95k
            _binary_data[read_count].data = _data.mutable_data() + start_offset;
286
1.95k
            _binary_data[read_count].size = offset(ord + 1) - start_offset;
287
1.95k
            read_count++;
288
1.95k
        }
289
290
556
        if (LIKELY(read_count > 0)) {
291
556
            dst->insert_many_strings(_binary_data.data(), read_count);
292
556
        }
293
294
556
        *n = read_count;
295
556
        return Status::OK();
296
556
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE
Line
Count
Source
245
44
                          MutableColumnPtr& dst) override {
246
44
        DCHECK(_parsed);
247
44
        if (*n == 0) [[unlikely]] {
248
0
            *n = 0;
249
0
            return Status::OK();
250
0
        }
251
252
44
        auto total = *n;
253
254
44
        if (_options.only_read_offsets) {
255
            // OFFSET_ONLY mode: read string lengths from page offset trailer
256
            // without copying actual char data. This allows length() to work.
257
0
            size_t read_count = 0;
258
0
            _offsets.resize(total);
259
0
            for (size_t i = 0; i < total; ++i) {
260
0
                ordinal_t ord = rowids[i] - page_first_ordinal;
261
0
                if (UNLIKELY(ord >= _num_elems)) {
262
0
                    break;
263
0
                }
264
0
                uint32_t str_start = offset(ord);
265
0
                uint32_t str_end = offset(ord + 1);
266
0
                _offsets[read_count] = str_end - str_start;
267
0
                read_count++;
268
0
            }
269
0
            if (read_count > 0) {
270
0
                dst->insert_offsets_from_lengths(_offsets.data(), read_count);
271
0
            }
272
0
            *n = read_count;
273
0
            return Status::OK();
274
0
        }
275
276
44
        size_t read_count = 0;
277
44
        _binary_data.resize(total);
278
99
        for (size_t i = 0; i < total; ++i) {
279
55
            ordinal_t ord = rowids[i] - page_first_ordinal;
280
55
            if (UNLIKELY(ord >= _num_elems)) {
281
0
                break;
282
0
            }
283
284
55
            const uint32_t start_offset = offset(ord);
285
55
            _binary_data[read_count].data = _data.mutable_data() + start_offset;
286
55
            _binary_data[read_count].size = offset(ord + 1) - start_offset;
287
55
            read_count++;
288
55
        }
289
290
44
        if (LIKELY(read_count > 0)) {
291
44
            dst->insert_many_strings(_binary_data.data(), read_count);
292
44
        }
293
294
44
        *n = read_count;
295
44
        return Status::OK();
296
44
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE
Line
Count
Source
245
1
                          MutableColumnPtr& dst) override {
246
1
        DCHECK(_parsed);
247
1
        if (*n == 0) [[unlikely]] {
248
0
            *n = 0;
249
0
            return Status::OK();
250
0
        }
251
252
1
        auto total = *n;
253
254
1
        if (_options.only_read_offsets) {
255
            // OFFSET_ONLY mode: read string lengths from page offset trailer
256
            // without copying actual char data. This allows length() to work.
257
0
            size_t read_count = 0;
258
0
            _offsets.resize(total);
259
0
            for (size_t i = 0; i < total; ++i) {
260
0
                ordinal_t ord = rowids[i] - page_first_ordinal;
261
0
                if (UNLIKELY(ord >= _num_elems)) {
262
0
                    break;
263
0
                }
264
0
                uint32_t str_start = offset(ord);
265
0
                uint32_t str_end = offset(ord + 1);
266
0
                _offsets[read_count] = str_end - str_start;
267
0
                read_count++;
268
0
            }
269
0
            if (read_count > 0) {
270
0
                dst->insert_offsets_from_lengths(_offsets.data(), read_count);
271
0
            }
272
0
            *n = read_count;
273
0
            return Status::OK();
274
0
        }
275
276
1
        size_t read_count = 0;
277
1
        _binary_data.resize(total);
278
5
        for (size_t i = 0; i < total; ++i) {
279
4
            ordinal_t ord = rowids[i] - page_first_ordinal;
280
4
            if (UNLIKELY(ord >= _num_elems)) {
281
0
                break;
282
0
            }
283
284
4
            const uint32_t start_offset = offset(ord);
285
4
            _binary_data[read_count].data = _data.mutable_data() + start_offset;
286
4
            _binary_data[read_count].size = offset(ord + 1) - start_offset;
287
4
            read_count++;
288
4
        }
289
290
1
        if (LIKELY(read_count > 0)) {
291
1
            dst->insert_many_strings(_binary_data.data(), read_count);
292
1
        }
293
294
1
        *n = read_count;
295
1
        return Status::OK();
296
1
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE
Line
Count
Source
245
4
                          MutableColumnPtr& dst) override {
246
4
        DCHECK(_parsed);
247
4
        if (*n == 0) [[unlikely]] {
248
0
            *n = 0;
249
0
            return Status::OK();
250
0
        }
251
252
4
        auto total = *n;
253
254
4
        if (_options.only_read_offsets) {
255
            // OFFSET_ONLY mode: read string lengths from page offset trailer
256
            // without copying actual char data. This allows length() to work.
257
0
            size_t read_count = 0;
258
0
            _offsets.resize(total);
259
0
            for (size_t i = 0; i < total; ++i) {
260
0
                ordinal_t ord = rowids[i] - page_first_ordinal;
261
0
                if (UNLIKELY(ord >= _num_elems)) {
262
0
                    break;
263
0
                }
264
0
                uint32_t str_start = offset(ord);
265
0
                uint32_t str_end = offset(ord + 1);
266
0
                _offsets[read_count] = str_end - str_start;
267
0
                read_count++;
268
0
            }
269
0
            if (read_count > 0) {
270
0
                dst->insert_offsets_from_lengths(_offsets.data(), read_count);
271
0
            }
272
0
            *n = read_count;
273
0
            return Status::OK();
274
0
        }
275
276
4
        size_t read_count = 0;
277
4
        _binary_data.resize(total);
278
8
        for (size_t i = 0; i < total; ++i) {
279
4
            ordinal_t ord = rowids[i] - page_first_ordinal;
280
4
            if (UNLIKELY(ord >= _num_elems)) {
281
0
                break;
282
0
            }
283
284
4
            const uint32_t start_offset = offset(ord);
285
4
            _binary_data[read_count].data = _data.mutable_data() + start_offset;
286
4
            _binary_data[read_count].size = offset(ord + 1) - start_offset;
287
4
            read_count++;
288
4
        }
289
290
4
        if (LIKELY(read_count > 0)) {
291
4
            dst->insert_many_strings(_binary_data.data(), read_count);
292
4
        }
293
294
4
        *n = read_count;
295
4
        return Status::OK();
296
4
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE
297
298
8.23k
    size_t count() const override {
299
8.23k
        DCHECK(_parsed);
300
8.23k
        return _num_elems;
301
8.23k
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE5countEv
Line
Count
Source
298
1.32k
    size_t count() const override {
299
        DCHECK(_parsed);
300
1.32k
        return _num_elems;
301
1.32k
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE5countEv
Line
Count
Source
298
6.26k
    size_t count() const override {
299
        DCHECK(_parsed);
300
6.26k
        return _num_elems;
301
6.26k
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE5countEv
Line
Count
Source
298
61
    size_t count() const override {
299
        DCHECK(_parsed);
300
61
        return _num_elems;
301
61
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE5countEv
Line
Count
Source
298
1
    size_t count() const override {
299
        DCHECK(_parsed);
300
1
        return _num_elems;
301
1
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE5countEv
Line
Count
Source
298
44
    size_t count() const override {
299
        DCHECK(_parsed);
300
44
        return _num_elems;
301
44
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE5countEv
Line
Count
Source
298
538
    size_t count() const override {
299
        DCHECK(_parsed);
300
538
        return _num_elems;
301
538
    }
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE5countEv
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE5countEv
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE5countEv
302
303
458
    size_t current_index() const override {
304
458
        DCHECK(_parsed);
305
458
        return _cur_idx;
306
458
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE13current_indexEv
Line
Count
Source
303
307
    size_t current_index() const override {
304
        DCHECK(_parsed);
305
307
        return _cur_idx;
306
307
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE13current_indexEv
Line
Count
Source
303
4
    size_t current_index() const override {
304
        DCHECK(_parsed);
305
4
        return _cur_idx;
306
4
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE13current_indexEv
Line
Count
Source
303
4
    size_t current_index() const override {
304
        DCHECK(_parsed);
305
4
        return _cur_idx;
306
4
    }
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE13current_indexEv
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE13current_indexEv
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE13current_indexEv
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE13current_indexEv
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE13current_indexEv
Line
Count
Source
303
143
    size_t current_index() const override {
304
        DCHECK(_parsed);
305
143
        return _cur_idx;
306
143
    }
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE13current_indexEv
307
308
4.06k
    Status get_dict_word_info(StringRef* dict_word_info) override {
309
4.06k
        if (UNLIKELY(_num_elems <= 0)) {
310
3
            return Status::OK();
311
3
        }
312
313
4.06k
        char* data_begin = (char*)&_data[0];
314
4.06k
        char* offset_ptr = (char*)&_data[_offsets_pos];
315
316
94.6k
        for (uint32_t i = 0; i < _num_elems; ++i) {
317
90.5k
            uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr);
318
90.5k
            if (offset > _offsets_pos) {
319
0
                return Status::Corruption(
320
0
                        "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
321
0
                        ", offset_pos: {}, offset: {}",
322
0
                        _data.size, _num_elems, _offsets_pos, offset);
323
0
            }
324
90.5k
            dict_word_info[i].data = data_begin + offset;
325
90.5k
            offset_ptr += sizeof(uint32_t);
326
90.5k
        }
327
328
90.5k
        for (int i = 0; i < (int)_num_elems - 1; ++i) {
329
86.5k
            dict_word_info[i].size =
330
86.5k
                    (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data;
331
86.5k
        }
332
333
4.06k
        dict_word_info[_num_elems - 1].size =
334
4.06k
                (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data;
335
4.06k
        return Status::OK();
336
4.06k
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE18get_dict_word_infoEPNS_9StringRefE
Line
Count
Source
308
646
    Status get_dict_word_info(StringRef* dict_word_info) override {
309
646
        if (UNLIKELY(_num_elems <= 0)) {
310
0
            return Status::OK();
311
0
        }
312
313
646
        char* data_begin = (char*)&_data[0];
314
646
        char* offset_ptr = (char*)&_data[_offsets_pos];
315
316
4.65k
        for (uint32_t i = 0; i < _num_elems; ++i) {
317
4.00k
            uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr);
318
4.00k
            if (offset > _offsets_pos) {
319
0
                return Status::Corruption(
320
0
                        "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
321
0
                        ", offset_pos: {}, offset: {}",
322
0
                        _data.size, _num_elems, _offsets_pos, offset);
323
0
            }
324
4.00k
            dict_word_info[i].data = data_begin + offset;
325
4.00k
            offset_ptr += sizeof(uint32_t);
326
4.00k
        }
327
328
4.00k
        for (int i = 0; i < (int)_num_elems - 1; ++i) {
329
3.36k
            dict_word_info[i].size =
330
3.36k
                    (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data;
331
3.36k
        }
332
333
646
        dict_word_info[_num_elems - 1].size =
334
646
                (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data;
335
646
        return Status::OK();
336
646
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE18get_dict_word_infoEPNS_9StringRefE
Line
Count
Source
308
3.11k
    Status get_dict_word_info(StringRef* dict_word_info) override {
309
3.11k
        if (UNLIKELY(_num_elems <= 0)) {
310
2
            return Status::OK();
311
2
        }
312
313
3.10k
        char* data_begin = (char*)&_data[0];
314
3.10k
        char* offset_ptr = (char*)&_data[_offsets_pos];
315
316
77.8k
        for (uint32_t i = 0; i < _num_elems; ++i) {
317
74.7k
            uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr);
318
74.7k
            if (offset > _offsets_pos) {
319
0
                return Status::Corruption(
320
0
                        "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
321
0
                        ", offset_pos: {}, offset: {}",
322
0
                        _data.size, _num_elems, _offsets_pos, offset);
323
0
            }
324
74.7k
            dict_word_info[i].data = data_begin + offset;
325
74.7k
            offset_ptr += sizeof(uint32_t);
326
74.7k
        }
327
328
74.7k
        for (int i = 0; i < (int)_num_elems - 1; ++i) {
329
71.6k
            dict_word_info[i].size =
330
71.6k
                    (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data;
331
71.6k
        }
332
333
3.10k
        dict_word_info[_num_elems - 1].size =
334
3.10k
                (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data;
335
3.10k
        return Status::OK();
336
3.10k
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE18get_dict_word_infoEPNS_9StringRefE
Line
Count
Source
308
26
    Status get_dict_word_info(StringRef* dict_word_info) override {
309
26
        if (UNLIKELY(_num_elems <= 0)) {
310
0
            return Status::OK();
311
0
        }
312
313
26
        char* data_begin = (char*)&_data[0];
314
26
        char* offset_ptr = (char*)&_data[_offsets_pos];
315
316
1.45k
        for (uint32_t i = 0; i < _num_elems; ++i) {
317
1.43k
            uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr);
318
1.43k
            if (offset > _offsets_pos) {
319
0
                return Status::Corruption(
320
0
                        "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
321
0
                        ", offset_pos: {}, offset: {}",
322
0
                        _data.size, _num_elems, _offsets_pos, offset);
323
0
            }
324
1.43k
            dict_word_info[i].data = data_begin + offset;
325
1.43k
            offset_ptr += sizeof(uint32_t);
326
1.43k
        }
327
328
1.43k
        for (int i = 0; i < (int)_num_elems - 1; ++i) {
329
1.40k
            dict_word_info[i].size =
330
1.40k
                    (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data;
331
1.40k
        }
332
333
26
        dict_word_info[_num_elems - 1].size =
334
26
                (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data;
335
26
        return Status::OK();
336
26
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE18get_dict_word_infoEPNS_9StringRefE
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE18get_dict_word_infoEPNS_9StringRefE
Line
Count
Source
308
21
    Status get_dict_word_info(StringRef* dict_word_info) override {
309
21
        if (UNLIKELY(_num_elems <= 0)) {
310
0
            return Status::OK();
311
0
        }
312
313
21
        char* data_begin = (char*)&_data[0];
314
21
        char* offset_ptr = (char*)&_data[_offsets_pos];
315
316
10.1k
        for (uint32_t i = 0; i < _num_elems; ++i) {
317
10.0k
            uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr);
318
10.0k
            if (offset > _offsets_pos) {
319
0
                return Status::Corruption(
320
0
                        "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
321
0
                        ", offset_pos: {}, offset: {}",
322
0
                        _data.size, _num_elems, _offsets_pos, offset);
323
0
            }
324
10.0k
            dict_word_info[i].data = data_begin + offset;
325
10.0k
            offset_ptr += sizeof(uint32_t);
326
10.0k
        }
327
328
10.0k
        for (int i = 0; i < (int)_num_elems - 1; ++i) {
329
10.0k
            dict_word_info[i].size =
330
10.0k
                    (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data;
331
10.0k
        }
332
333
21
        dict_word_info[_num_elems - 1].size =
334
21
                (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data;
335
21
        return Status::OK();
336
21
    }
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE18get_dict_word_infoEPNS_9StringRefE
Line
Count
Source
308
263
    Status get_dict_word_info(StringRef* dict_word_info) override {
309
263
        if (UNLIKELY(_num_elems <= 0)) {
310
1
            return Status::OK();
311
1
        }
312
313
262
        char* data_begin = (char*)&_data[0];
314
262
        char* offset_ptr = (char*)&_data[_offsets_pos];
315
316
550
        for (uint32_t i = 0; i < _num_elems; ++i) {
317
288
            uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr);
318
288
            if (offset > _offsets_pos) {
319
0
                return Status::Corruption(
320
0
                        "file corruption: offsets pos beyonds data_size: {}, num_element: {}"
321
0
                        ", offset_pos: {}, offset: {}",
322
0
                        _data.size, _num_elems, _offsets_pos, offset);
323
0
            }
324
288
            dict_word_info[i].data = data_begin + offset;
325
288
            offset_ptr += sizeof(uint32_t);
326
288
        }
327
328
288
        for (int i = 0; i < (int)_num_elems - 1; ++i) {
329
26
            dict_word_info[i].size =
330
26
                    (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data;
331
26
        }
332
333
262
        dict_word_info[_num_elems - 1].size =
334
262
                (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data;
335
262
        return Status::OK();
336
262
    }
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE18get_dict_word_infoEPNS_9StringRefE
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE18get_dict_word_infoEPNS_9StringRefE
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE18get_dict_word_infoEPNS_9StringRefE
337
338
private:
339
    static constexpr size_t SIZE_OF_INT32 = sizeof(uint32_t);
340
    // Return the offset within '_data' where the string value with index 'idx' can be found.
341
6.51k
    uint32_t offset(size_t idx) const {
342
6.51k
        if (idx >= _num_elems) {
343
2.67k
            return _offsets_pos;
344
2.67k
        }
345
3.84k
        return guarded_offset(idx);
346
6.51k
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE6offsetEm
Line
Count
Source
341
5.88k
    uint32_t offset(size_t idx) const {
342
5.88k
        if (idx >= _num_elems) {
343
2.35k
            return _offsets_pos;
344
2.35k
        }
345
3.53k
        return guarded_offset(idx);
346
5.88k
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE6offsetEm
Line
Count
Source
341
212
    uint32_t offset(size_t idx) const {
342
212
        if (idx >= _num_elems) {
343
76
            return _offsets_pos;
344
76
        }
345
136
        return guarded_offset(idx);
346
212
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE6offsetEm
Line
Count
Source
341
101
    uint32_t offset(size_t idx) const {
342
101
        if (idx >= _num_elems) {
343
34
            return _offsets_pos;
344
34
        }
345
67
        return guarded_offset(idx);
346
101
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE6offsetEm
Line
Count
Source
341
38
    uint32_t offset(size_t idx) const {
342
38
        if (idx >= _num_elems) {
343
38
            return _offsets_pos;
344
38
        }
345
0
        return guarded_offset(idx);
346
38
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE6offsetEm
Line
Count
Source
341
82
    uint32_t offset(size_t idx) const {
342
82
        if (idx >= _num_elems) {
343
25
            return _offsets_pos;
344
25
        }
345
57
        return guarded_offset(idx);
346
82
    }
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE6offsetEm
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE6offsetEm
Line
Count
Source
341
18
    uint32_t offset(size_t idx) const {
342
18
        if (idx >= _num_elems) {
343
18
            return _offsets_pos;
344
18
        }
345
0
        return guarded_offset(idx);
346
18
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE6offsetEm
Line
Count
Source
341
170
    uint32_t offset(size_t idx) const {
342
170
        if (idx >= _num_elems) {
343
114
            return _offsets_pos;
344
114
        }
345
56
        return guarded_offset(idx);
346
170
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE6offsetEm
Line
Count
Source
341
16
    uint32_t offset(size_t idx) const {
342
16
        if (idx >= _num_elems) {
343
16
            return _offsets_pos;
344
16
        }
345
0
        return guarded_offset(idx);
346
16
    }
347
348
464k
    uint32_t guarded_offset(size_t idx) const {
349
464k
        const auto* p =
350
464k
                reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]);
351
464k
        return decode_fixed32_le(p);
352
464k
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE14guarded_offsetEm
Line
Count
Source
348
460k
    uint32_t guarded_offset(size_t idx) const {
349
460k
        const auto* p =
350
460k
                reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]);
351
460k
        return decode_fixed32_le(p);
352
460k
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE14guarded_offsetEm
Line
Count
Source
348
851
    uint32_t guarded_offset(size_t idx) const {
349
851
        const auto* p =
350
851
                reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]);
351
851
        return decode_fixed32_le(p);
352
851
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE14guarded_offsetEm
Line
Count
Source
348
748
    uint32_t guarded_offset(size_t idx) const {
349
748
        const auto* p =
350
748
                reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]);
351
748
        return decode_fixed32_le(p);
352
748
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE14guarded_offsetEm
Line
Count
Source
348
724
    uint32_t guarded_offset(size_t idx) const {
349
724
        const auto* p =
350
724
                reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]);
351
724
        return decode_fixed32_le(p);
352
724
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE14guarded_offsetEm
Line
Count
Source
348
702
    uint32_t guarded_offset(size_t idx) const {
349
702
        const auto* p =
350
702
                reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]);
351
702
        return decode_fixed32_le(p);
352
702
    }
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE14guarded_offsetEm
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE14guarded_offsetEm
Line
Count
Source
348
120
    uint32_t guarded_offset(size_t idx) const {
349
120
        const auto* p =
350
120
                reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]);
351
120
        return decode_fixed32_le(p);
352
120
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE14guarded_offsetEm
Line
Count
Source
348
348
    uint32_t guarded_offset(size_t idx) const {
349
348
        const auto* p =
350
348
                reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]);
351
348
        return decode_fixed32_le(p);
352
348
    }
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE14guarded_offsetEm
Line
Count
Source
348
360
    uint32_t guarded_offset(size_t idx) const {
349
360
        const auto* p =
350
360
                reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]);
351
360
        return decode_fixed32_le(p);
352
360
    }
353
354
    Slice _data;
355
    PageDecoderOptions _options;
356
    bool _parsed;
357
358
    uint32_t _num_elems;
359
    uint32_t _offsets_pos;
360
361
    std::vector<uint32_t> _offsets;
362
    std::vector<StringRef> _binary_data;
363
364
    // Index of the currently seeked element in the page.
365
    size_t _cur_idx;
366
    friend class BinaryDictPageDecoder;
367
    friend class FileColumnIterator;
368
};
369
370
} // namespace segment_v2
371
} // namespace doris