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 | 49.7k | Status init() override { return reset(); }_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE4initEv Line | Count | Source | 50 | 13.9k | Status init() override { return reset(); } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE4initEv Line | Count | Source | 50 | 6 | Status init() override { return reset(); } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE4initEv Line | Count | Source | 50 | 166 | Status init() override { return reset(); } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE4initEv Line | Count | Source | 50 | 4 | Status init() override { return reset(); } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE4initEv _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE4initEv Line | Count | Source | 50 | 36 | Status init() override { return reset(); } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE4initEv Line | Count | Source | 50 | 35.4k | Status init() override { return reset(); } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE4initEv Line | Count | Source | 50 | 36 | Status init() override { return reset(); } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE4initEv Line | Count | Source | 50 | 108 | Status init() override { return reset(); } |
|
51 | | |
52 | 3.49M | bool is_page_full() override { |
53 | 3.49M | bool ret = false; |
54 | 3.49M | if (_options.is_dict_page) { |
55 | | // dict_page_size is 0, do not limit the page size |
56 | 2.64M | ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size; |
57 | 2.64M | } else { |
58 | 844k | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; |
59 | 844k | } |
60 | 3.49M | return ret; |
61 | 3.49M | } _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE12is_page_fullEv Line | Count | Source | 52 | 3.35M | bool is_page_full() override { | 53 | 3.35M | bool ret = false; | 54 | 3.35M | if (_options.is_dict_page) { | 55 | | // dict_page_size is 0, do not limit the page size | 56 | 2.64M | ret = _options.dict_page_size != 0 && _size_estimate > _options.dict_page_size; | 57 | 2.64M | } else { | 58 | 705k | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; | 59 | 705k | } | 60 | 3.35M | return ret; | 61 | 3.35M | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE12is_page_fullEv Line | Count | Source | 52 | 1.12k | bool is_page_full() override { | 53 | 1.12k | bool ret = false; | 54 | 1.12k | 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 | 1.12k | } else { | 58 | 1.12k | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; | 59 | 1.12k | } | 60 | 1.12k | return ret; | 61 | 1.12k | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE12is_page_fullEv Line | Count | Source | 52 | 1.85k | bool is_page_full() override { | 53 | 1.85k | bool ret = false; | 54 | 1.85k | 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 | 1.85k | } else { | 58 | 1.85k | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; | 59 | 1.85k | } | 60 | 1.85k | return ret; | 61 | 1.85k | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE12is_page_fullEv Line | Count | Source | 52 | 1.11k | bool is_page_full() override { | 53 | 1.11k | bool ret = false; | 54 | 1.11k | 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 | 1.11k | } else { | 58 | 1.11k | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; | 59 | 1.11k | } | 60 | 1.11k | return ret; | 61 | 1.11k | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE12is_page_fullEv _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE12is_page_fullEv Line | Count | Source | 52 | 384 | bool is_page_full() override { | 53 | 384 | bool ret = false; | 54 | 384 | 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 | 384 | } else { | 58 | 384 | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; | 59 | 384 | } | 60 | 384 | return ret; | 61 | 384 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE12is_page_fullEv Line | Count | Source | 52 | 132k | bool is_page_full() override { | 53 | 132k | bool ret = false; | 54 | 132k | 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 | 132k | } else { | 58 | 132k | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; | 59 | 132k | } | 60 | 132k | return ret; | 61 | 132k | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE12is_page_fullEv Line | Count | Source | 52 | 712 | bool is_page_full() override { | 53 | 712 | bool ret = false; | 54 | 712 | 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 | 712 | } else { | 58 | 712 | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; | 59 | 712 | } | 60 | 712 | return ret; | 61 | 712 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE12is_page_fullEv Line | Count | Source | 52 | 1.60k | bool is_page_full() override { | 53 | 1.60k | bool ret = false; | 54 | 1.60k | 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 | 1.60k | } else { | 58 | 1.60k | ret = _options.data_page_size != 0 && _size_estimate > _options.data_page_size; | 59 | 1.60k | } | 60 | 1.60k | return ret; | 61 | 1.60k | } |
|
62 | | |
63 | 476k | Status add(const uint8_t* vals, size_t* count) override { |
64 | 476k | DCHECK(!_finished); |
65 | 476k | DCHECK_GT(*count, 0); |
66 | 476k | size_t i = 0; |
67 | | |
68 | | // If the page is full, should stop adding more items. |
69 | 1.03M | while (!is_page_full() && i < *count) { |
70 | 560k | const auto* src = reinterpret_cast<const Slice*>(vals); |
71 | 560k | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { |
72 | 44.2k | if (_options.need_check_bitmap) { |
73 | 410 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data))); |
74 | 410 | } |
75 | 44.2k | } |
76 | 44.2k | size_t offset = _buffer.size(); |
77 | 560k | _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 | 560k | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); |
81 | | |
82 | 560k | _last_value_size = cast_set<uint32_t>(src->size); |
83 | 560k | _size_estimate += src->size; |
84 | 560k | _size_estimate += sizeof(uint32_t); |
85 | 560k | _raw_data_size += src->size; |
86 | | |
87 | 560k | i++; |
88 | 560k | vals += sizeof(Slice); |
89 | 560k | } |
90 | | |
91 | 476k | *count = i; |
92 | 476k | return Status::OK(); |
93 | 476k | } _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE3addEPKhPm Line | Count | Source | 63 | 431k | Status add(const uint8_t* vals, size_t* count) override { | 64 | 431k | DCHECK(!_finished); | 65 | 431k | DCHECK_GT(*count, 0); | 66 | 431k | size_t i = 0; | 67 | | | 68 | | // If the page is full, should stop adding more items. | 69 | 942k | while (!is_page_full() && i < *count) { | 70 | 510k | 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 | 510k | size_t offset = _buffer.size(); | 77 | 510k | _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 | 510k | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); | 81 | | | 82 | 510k | _last_value_size = cast_set<uint32_t>(src->size); | 83 | 510k | _size_estimate += src->size; | 84 | 510k | _size_estimate += sizeof(uint32_t); | 85 | 510k | _raw_data_size += src->size; | 86 | | | 87 | 510k | i++; | 88 | 510k | vals += sizeof(Slice); | 89 | 510k | } | 90 | | | 91 | 431k | *count = i; | 92 | 431k | return Status::OK(); | 93 | 431k | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE3addEPKhPm Line | Count | Source | 63 | 130 | Status add(const uint8_t* vals, size_t* count) override { | 64 | 130 | DCHECK(!_finished); | 65 | 130 | DCHECK_GT(*count, 0); | 66 | 130 | size_t i = 0; | 67 | | | 68 | | // If the page is full, should stop adding more items. | 69 | 1.00k | while (!is_page_full() && i < *count) { | 70 | 870 | 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 | 870 | size_t offset = _buffer.size(); | 77 | 870 | _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 | 870 | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); | 81 | | | 82 | 870 | _last_value_size = cast_set<uint32_t>(src->size); | 83 | 870 | _size_estimate += src->size; | 84 | 870 | _size_estimate += sizeof(uint32_t); | 85 | 870 | _raw_data_size += src->size; | 86 | | | 87 | 870 | i++; | 88 | 870 | vals += sizeof(Slice); | 89 | 870 | } | 90 | | | 91 | 130 | *count = i; | 92 | 130 | return Status::OK(); | 93 | 130 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE3addEPKhPm Line | Count | Source | 63 | 282 | Status add(const uint8_t* vals, size_t* count) override { | 64 | 282 | DCHECK(!_finished); | 65 | 282 | DCHECK_GT(*count, 0); | 66 | 282 | size_t i = 0; | 67 | | | 68 | | // If the page is full, should stop adding more items. | 69 | 1.56k | while (!is_page_full() && i < *count) { | 70 | 1.28k | 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.28k | size_t offset = _buffer.size(); | 77 | 1.28k | _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.28k | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); | 81 | | | 82 | 1.28k | _last_value_size = cast_set<uint32_t>(src->size); | 83 | 1.28k | _size_estimate += src->size; | 84 | 1.28k | _size_estimate += sizeof(uint32_t); | 85 | 1.28k | _raw_data_size += src->size; | 86 | | | 87 | 1.28k | i++; | 88 | 1.28k | vals += sizeof(Slice); | 89 | 1.28k | } | 90 | | | 91 | 282 | *count = i; | 92 | 282 | return Status::OK(); | 93 | 282 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE3addEPKhPm Line | Count | Source | 63 | 128 | Status add(const uint8_t* vals, size_t* count) override { | 64 | 128 | DCHECK(!_finished); | 65 | 128 | DCHECK_GT(*count, 0); | 66 | 128 | size_t i = 0; | 67 | | | 68 | | // If the page is full, should stop adding more items. | 69 | 988 | while (!is_page_full() && i < *count) { | 70 | 860 | 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 | 860 | size_t offset = _buffer.size(); | 77 | 860 | _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 | 860 | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); | 81 | | | 82 | 860 | _last_value_size = cast_set<uint32_t>(src->size); | 83 | 860 | _size_estimate += src->size; | 84 | 860 | _size_estimate += sizeof(uint32_t); | 85 | 860 | _raw_data_size += src->size; | 86 | | | 87 | 860 | i++; | 88 | 860 | vals += sizeof(Slice); | 89 | 860 | } | 90 | | | 91 | 128 | *count = i; | 92 | 128 | return Status::OK(); | 93 | 128 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE3addEPKhPm _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE3addEPKhPm Line | Count | Source | 63 | 64 | Status add(const uint8_t* vals, size_t* count) override { | 64 | 64 | DCHECK(!_finished); | 65 | 64 | DCHECK_GT(*count, 0); | 66 | 64 | size_t i = 0; | 67 | | | 68 | | // If the page is full, should stop adding more items. | 69 | 320 | while (!is_page_full() && i < *count) { | 70 | 256 | 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 | 256 | size_t offset = _buffer.size(); | 77 | 256 | _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 | 256 | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); | 81 | | | 82 | 256 | _last_value_size = cast_set<uint32_t>(src->size); | 83 | 256 | _size_estimate += src->size; | 84 | 256 | _size_estimate += sizeof(uint32_t); | 85 | 256 | _raw_data_size += src->size; | 86 | | | 87 | 256 | i++; | 88 | 256 | vals += sizeof(Slice); | 89 | 256 | } | 90 | | | 91 | 64 | *count = i; | 92 | 64 | return Status::OK(); | 93 | 64 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE3addEPKhPm Line | Count | Source | 63 | 43.9k | Status add(const uint8_t* vals, size_t* count) override { | 64 | 43.9k | DCHECK(!_finished); | 65 | 43.9k | DCHECK_GT(*count, 0); | 66 | 43.9k | size_t i = 0; | 67 | | | 68 | | // If the page is full, should stop adding more items. | 69 | 88.2k | while (!is_page_full() && i < *count) { | 70 | 44.2k | const auto* src = reinterpret_cast<const Slice*>(vals); | 71 | 44.2k | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 72 | 44.2k | if (_options.need_check_bitmap) { | 73 | 410 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(src->data))); | 74 | 410 | } | 75 | 44.2k | } | 76 | 44.2k | size_t offset = _buffer.size(); | 77 | 44.2k | _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 | 44.2k | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); | 81 | | | 82 | 44.2k | _last_value_size = cast_set<uint32_t>(src->size); | 83 | 44.2k | _size_estimate += src->size; | 84 | 44.2k | _size_estimate += sizeof(uint32_t); | 85 | 44.2k | _raw_data_size += src->size; | 86 | | | 87 | 44.2k | i++; | 88 | 44.2k | vals += sizeof(Slice); | 89 | 44.2k | } | 90 | | | 91 | 43.9k | *count = i; | 92 | 43.9k | return Status::OK(); | 93 | 43.9k | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE3addEPKhPm Line | Count | Source | 63 | 68 | Status add(const uint8_t* vals, size_t* count) override { | 64 | 68 | DCHECK(!_finished); | 65 | 68 | DCHECK_GT(*count, 0); | 66 | 68 | size_t i = 0; | 67 | | | 68 | | // If the page is full, should stop adding more items. | 69 | 644 | while (!is_page_full() && i < *count) { | 70 | 576 | 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 | 576 | size_t offset = _buffer.size(); | 77 | 576 | _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 | 576 | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); | 81 | | | 82 | 576 | _last_value_size = cast_set<uint32_t>(src->size); | 83 | 576 | _size_estimate += src->size; | 84 | 576 | _size_estimate += sizeof(uint32_t); | 85 | 576 | _raw_data_size += src->size; | 86 | | | 87 | 576 | i++; | 88 | 576 | vals += sizeof(Slice); | 89 | 576 | } | 90 | | | 91 | 68 | *count = i; | 92 | 68 | return Status::OK(); | 93 | 68 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE3addEPKhPm Line | Count | Source | 63 | 176 | Status add(const uint8_t* vals, size_t* count) override { | 64 | 176 | DCHECK(!_finished); | 65 | 176 | DCHECK_GT(*count, 0); | 66 | 176 | size_t i = 0; | 67 | | | 68 | | // If the page is full, should stop adding more items. | 69 | 1.42k | while (!is_page_full() && i < *count) { | 70 | 1.24k | 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.24k | size_t offset = _buffer.size(); | 77 | 1.24k | _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.24k | RETURN_IF_CATCH_EXCEPTION(_buffer.append(src->data, src->size)); | 81 | | | 82 | 1.24k | _last_value_size = cast_set<uint32_t>(src->size); | 83 | 1.24k | _size_estimate += src->size; | 84 | 1.24k | _size_estimate += sizeof(uint32_t); | 85 | 1.24k | _raw_data_size += src->size; | 86 | | | 87 | 1.24k | i++; | 88 | 1.24k | vals += sizeof(Slice); | 89 | 1.24k | } | 90 | | | 91 | 176 | *count = i; | 92 | 176 | return Status::OK(); | 93 | 176 | } |
|
94 | | |
95 | 53.9k | Status finish(OwnedSlice* slice) override { |
96 | 53.9k | DCHECK(!_finished); |
97 | 53.9k | _finished = true; |
98 | 53.9k | RETURN_IF_CATCH_EXCEPTION({ |
99 | | // Set up trailer |
100 | 53.9k | for (uint32_t _offset : _offsets) { |
101 | 53.9k | put_fixed32_le(&_buffer, _offset); |
102 | 53.9k | } |
103 | 53.9k | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); |
104 | 53.9k | *slice = _buffer.build(); |
105 | 53.9k | }); |
106 | 53.9k | return Status::OK(); |
107 | 53.9k | } _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE6finishEPNS_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_9FieldTypeE13EE6finishEPNS_10OwnedSliceE Line | Count | Source | 95 | 38 | Status finish(OwnedSlice* slice) override { | 96 | 38 | DCHECK(!_finished); | 97 | 38 | _finished = true; | 98 | 38 | RETURN_IF_CATCH_EXCEPTION({ | 99 | | // Set up trailer | 100 | 38 | for (uint32_t _offset : _offsets) { | 101 | 38 | put_fixed32_le(&_buffer, _offset); | 102 | 38 | } | 103 | 38 | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); | 104 | 38 | *slice = _buffer.build(); | 105 | 38 | }); | 106 | 38 | return Status::OK(); | 107 | 38 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE6finishEPNS_10OwnedSliceE Line | Count | Source | 95 | 194 | Status finish(OwnedSlice* slice) override { | 96 | 194 | DCHECK(!_finished); | 97 | 194 | _finished = true; | 98 | 194 | RETURN_IF_CATCH_EXCEPTION({ | 99 | | // Set up trailer | 100 | 194 | for (uint32_t _offset : _offsets) { | 101 | 194 | put_fixed32_le(&_buffer, _offset); | 102 | 194 | } | 103 | 194 | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); | 104 | 194 | *slice = _buffer.build(); | 105 | 194 | }); | 106 | 194 | return Status::OK(); | 107 | 194 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE6finishEPNS_10OwnedSliceE Line | Count | Source | 95 | 36 | Status finish(OwnedSlice* slice) override { | 96 | 36 | DCHECK(!_finished); | 97 | 36 | _finished = true; | 98 | 36 | RETURN_IF_CATCH_EXCEPTION({ | 99 | | // Set up trailer | 100 | 36 | for (uint32_t _offset : _offsets) { | 101 | 36 | put_fixed32_le(&_buffer, _offset); | 102 | 36 | } | 103 | 36 | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); | 104 | 36 | *slice = _buffer.build(); | 105 | 36 | }); | 106 | 36 | return Status::OK(); | 107 | 36 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE6finishEPNS_10OwnedSliceE _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE6finishEPNS_10OwnedSliceE Line | Count | Source | 95 | 56 | Status finish(OwnedSlice* slice) override { | 96 | 56 | DCHECK(!_finished); | 97 | 56 | _finished = true; | 98 | 56 | RETURN_IF_CATCH_EXCEPTION({ | 99 | | // Set up trailer | 100 | 56 | for (uint32_t _offset : _offsets) { | 101 | 56 | put_fixed32_le(&_buffer, _offset); | 102 | 56 | } | 103 | 56 | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); | 104 | 56 | *slice = _buffer.build(); | 105 | 56 | }); | 106 | 56 | return Status::OK(); | 107 | 56 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE6finishEPNS_10OwnedSliceE Line | Count | Source | 95 | 35.4k | Status finish(OwnedSlice* slice) override { | 96 | 35.4k | DCHECK(!_finished); | 97 | 35.4k | _finished = true; | 98 | 35.4k | RETURN_IF_CATCH_EXCEPTION({ | 99 | | // Set up trailer | 100 | 35.4k | for (uint32_t _offset : _offsets) { | 101 | 35.4k | put_fixed32_le(&_buffer, _offset); | 102 | 35.4k | } | 103 | 35.4k | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); | 104 | 35.4k | *slice = _buffer.build(); | 105 | 35.4k | }); | 106 | 35.4k | return Status::OK(); | 107 | 35.4k | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE6finishEPNS_10OwnedSliceE Line | Count | Source | 95 | 56 | Status finish(OwnedSlice* slice) override { | 96 | 56 | DCHECK(!_finished); | 97 | 56 | _finished = true; | 98 | 56 | RETURN_IF_CATCH_EXCEPTION({ | 99 | | // Set up trailer | 100 | 56 | for (uint32_t _offset : _offsets) { | 101 | 56 | put_fixed32_le(&_buffer, _offset); | 102 | 56 | } | 103 | 56 | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); | 104 | 56 | *slice = _buffer.build(); | 105 | 56 | }); | 106 | 56 | return Status::OK(); | 107 | 56 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE6finishEPNS_10OwnedSliceE Line | Count | Source | 95 | 148 | Status finish(OwnedSlice* slice) override { | 96 | 148 | DCHECK(!_finished); | 97 | 148 | _finished = true; | 98 | 148 | RETURN_IF_CATCH_EXCEPTION({ | 99 | | // Set up trailer | 100 | 148 | for (uint32_t _offset : _offsets) { | 101 | 148 | put_fixed32_le(&_buffer, _offset); | 102 | 148 | } | 103 | 148 | put_fixed32_le(&_buffer, cast_set<uint32_t>(_offsets.size())); | 104 | 148 | *slice = _buffer.build(); | 105 | 148 | }); | 106 | 148 | return Status::OK(); | 107 | 148 | } |
|
108 | | |
109 | 93.9k | Status reset() override { |
110 | 93.9k | RETURN_IF_CATCH_EXCEPTION({ |
111 | 93.9k | _offsets.clear(); |
112 | 93.9k | _buffer.clear(); |
113 | 93.9k | _buffer.reserve(_options.data_page_size == 0 |
114 | 93.9k | ? 1024 |
115 | 93.9k | : std::min(_options.data_page_size, _options.dict_page_size)); |
116 | 93.9k | _size_estimate = sizeof(uint32_t); |
117 | 93.9k | _finished = false; |
118 | 93.9k | _last_value_size = 0; |
119 | 93.9k | _raw_data_size = 0; |
120 | 93.9k | }); |
121 | 93.9k | return Status::OK(); |
122 | 93.9k | } _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE5resetEv Line | Count | Source | 109 | 22.2k | Status reset() override { | 110 | 22.2k | RETURN_IF_CATCH_EXCEPTION({ | 111 | 22.2k | _offsets.clear(); | 112 | 22.2k | _buffer.clear(); | 113 | 22.2k | _buffer.reserve(_options.data_page_size == 0 | 114 | 22.2k | ? 1024 | 115 | 22.2k | : std::min(_options.data_page_size, _options.dict_page_size)); | 116 | 22.2k | _size_estimate = sizeof(uint32_t); | 117 | 22.2k | _finished = false; | 118 | 22.2k | _last_value_size = 0; | 119 | 22.2k | _raw_data_size = 0; | 120 | 22.2k | }); | 121 | 22.2k | return Status::OK(); | 122 | 22.2k | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE5resetEv Line | Count | Source | 109 | 42 | Status reset() override { | 110 | 42 | RETURN_IF_CATCH_EXCEPTION({ | 111 | 42 | _offsets.clear(); | 112 | 42 | _buffer.clear(); | 113 | 42 | _buffer.reserve(_options.data_page_size == 0 | 114 | 42 | ? 1024 | 115 | 42 | : std::min(_options.data_page_size, _options.dict_page_size)); | 116 | 42 | _size_estimate = sizeof(uint32_t); | 117 | 42 | _finished = false; | 118 | 42 | _last_value_size = 0; | 119 | 42 | _raw_data_size = 0; | 120 | 42 | }); | 121 | 42 | return Status::OK(); | 122 | 42 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE5resetEv Line | Count | Source | 109 | 360 | Status reset() override { | 110 | 360 | RETURN_IF_CATCH_EXCEPTION({ | 111 | 360 | _offsets.clear(); | 112 | 360 | _buffer.clear(); | 113 | 360 | _buffer.reserve(_options.data_page_size == 0 | 114 | 360 | ? 1024 | 115 | 360 | : std::min(_options.data_page_size, _options.dict_page_size)); | 116 | 360 | _size_estimate = sizeof(uint32_t); | 117 | 360 | _finished = false; | 118 | 360 | _last_value_size = 0; | 119 | 360 | _raw_data_size = 0; | 120 | 360 | }); | 121 | 360 | return Status::OK(); | 122 | 360 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE5resetEv Line | Count | Source | 109 | 40 | Status reset() override { | 110 | 40 | RETURN_IF_CATCH_EXCEPTION({ | 111 | 40 | _offsets.clear(); | 112 | 40 | _buffer.clear(); | 113 | 40 | _buffer.reserve(_options.data_page_size == 0 | 114 | 40 | ? 1024 | 115 | 40 | : std::min(_options.data_page_size, _options.dict_page_size)); | 116 | 40 | _size_estimate = sizeof(uint32_t); | 117 | 40 | _finished = false; | 118 | 40 | _last_value_size = 0; | 119 | 40 | _raw_data_size = 0; | 120 | 40 | }); | 121 | 40 | return Status::OK(); | 122 | 40 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE5resetEv _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE5resetEv Line | Count | Source | 109 | 92 | Status reset() override { | 110 | 92 | RETURN_IF_CATCH_EXCEPTION({ | 111 | 92 | _offsets.clear(); | 112 | 92 | _buffer.clear(); | 113 | 92 | _buffer.reserve(_options.data_page_size == 0 | 114 | 92 | ? 1024 | 115 | 92 | : std::min(_options.data_page_size, _options.dict_page_size)); | 116 | 92 | _size_estimate = sizeof(uint32_t); | 117 | 92 | _finished = false; | 118 | 92 | _last_value_size = 0; | 119 | 92 | _raw_data_size = 0; | 120 | 92 | }); | 121 | 92 | return Status::OK(); | 122 | 92 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE5resetEv Line | Count | Source | 109 | 70.8k | Status reset() override { | 110 | 70.8k | RETURN_IF_CATCH_EXCEPTION({ | 111 | 70.8k | _offsets.clear(); | 112 | 70.8k | _buffer.clear(); | 113 | 70.8k | _buffer.reserve(_options.data_page_size == 0 | 114 | 70.8k | ? 1024 | 115 | 70.8k | : std::min(_options.data_page_size, _options.dict_page_size)); | 116 | 70.8k | _size_estimate = sizeof(uint32_t); | 117 | 70.8k | _finished = false; | 118 | 70.8k | _last_value_size = 0; | 119 | 70.8k | _raw_data_size = 0; | 120 | 70.8k | }); | 121 | 70.8k | return Status::OK(); | 122 | 70.8k | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE5resetEv Line | Count | Source | 109 | 92 | Status reset() override { | 110 | 92 | RETURN_IF_CATCH_EXCEPTION({ | 111 | 92 | _offsets.clear(); | 112 | 92 | _buffer.clear(); | 113 | 92 | _buffer.reserve(_options.data_page_size == 0 | 114 | 92 | ? 1024 | 115 | 92 | : std::min(_options.data_page_size, _options.dict_page_size)); | 116 | 92 | _size_estimate = sizeof(uint32_t); | 117 | 92 | _finished = false; | 118 | 92 | _last_value_size = 0; | 119 | 92 | _raw_data_size = 0; | 120 | 92 | }); | 121 | 92 | return Status::OK(); | 122 | 92 | } |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE5resetEv Line | Count | Source | 109 | 256 | Status reset() override { | 110 | 256 | RETURN_IF_CATCH_EXCEPTION({ | 111 | 256 | _offsets.clear(); | 112 | 256 | _buffer.clear(); | 113 | 256 | _buffer.reserve(_options.data_page_size == 0 | 114 | 256 | ? 1024 | 115 | 256 | : std::min(_options.data_page_size, _options.dict_page_size)); | 116 | 256 | _size_estimate = sizeof(uint32_t); | 117 | 256 | _finished = false; | 118 | 256 | _last_value_size = 0; | 119 | 256 | _raw_data_size = 0; | 120 | 256 | }); | 121 | 256 | return Status::OK(); | 122 | 256 | } |
|
123 | | |
124 | 36.3k | size_t count() const override { return _offsets.size(); }_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE5countEv Line | Count | Source | 124 | 1.05k | size_t count() const override { return _offsets.size(); } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EE5countEv _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE5countEv Line | Count | Source | 124 | 35.2k | size_t count() const override { return _offsets.size(); } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE5countEv |
125 | | |
126 | 3.45k | uint64_t size() const override { return _size_estimate; }_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE4sizeEv Line | Count | Source | 126 | 3.12k | uint64_t size() const override { return _size_estimate; } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE4sizeEv _ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE4sizeEv Line | Count | Source | 126 | 142 | 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 | 16 | uint64_t size() const override { return _size_estimate; } |
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE4sizeEv Line | Count | Source | 126 | 106 | uint64_t size() const override { return _size_estimate; } |
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE4sizeEv Line | Count | Source | 126 | 16 | uint64_t size() const override { return _size_estimate; } |
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE4sizeEv Line | Count | Source | 126 | 48 | uint64_t size() const override { return _size_estimate; } |
|
127 | | |
128 | 684 | uint64_t get_raw_data_size() const override { return _raw_data_size; }_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EE17get_raw_data_sizeEv Line | Count | Source | 128 | 32 | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EE17get_raw_data_sizeEv Line | Count | Source | 128 | 36 | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EE17get_raw_data_sizeEv Line | Count | Source | 128 | 194 | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EE17get_raw_data_sizeEv Line | Count | Source | 128 | 36 | 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 | 56 | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EE17get_raw_data_sizeEv Line | Count | Source | 128 | 126 | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EE17get_raw_data_sizeEv Line | Count | Source | 128 | 56 | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
_ZNK5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EE17get_raw_data_sizeEv Line | Count | Source | 128 | 148 | uint64_t get_raw_data_size() const override { return _raw_data_size; } |
|
129 | | |
130 | | private: |
131 | | BinaryPlainPageBuilder(const PageBuilderOptions& options) |
132 | 49.7k | : _size_estimate(0), _options(options) {}_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE17EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 132 | 13.9k | : _size_estimate(0), _options(options) {} |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE13EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 132 | 6 | : _size_estimate(0), _options(options) {} |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE26EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 132 | 166 | : _size_estimate(0), _options(options) {} |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE34EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 132 | 4 | : _size_estimate(0), _options(options) {} |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE35EEC2ERKNS0_18PageBuilderOptionsE _ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE23EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 132 | 36 | : _size_estimate(0), _options(options) {} |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE25EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 132 | 35.4k | : _size_estimate(0), _options(options) {} |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE27EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 132 | 36 | : _size_estimate(0), _options(options) {} |
_ZN5doris10segment_v222BinaryPlainPageBuilderILNS_9FieldTypeE36EEC2ERKNS0_18PageBuilderOptionsE Line | Count | Source | 132 | 108 | : _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 | 13.3k | : _data(data), |
152 | 13.3k | _options(options), |
153 | 13.3k | _parsed(false), |
154 | 13.3k | _num_elems(0), |
155 | 13.3k | _offsets_pos(0), |
156 | 13.3k | _cur_idx(0) {}_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 151 | 5.99k | : _data(data), | 152 | 5.99k | _options(options), | 153 | 5.99k | _parsed(false), | 154 | 5.99k | _num_elems(0), | 155 | 5.99k | _offsets_pos(0), | 156 | 5.99k | _cur_idx(0) {} |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 151 | 6.29k | : _data(data), | 152 | 6.29k | _options(options), | 153 | 6.29k | _parsed(false), | 154 | 6.29k | _num_elems(0), | 155 | 6.29k | _offsets_pos(0), | 156 | 6.29k | _cur_idx(0) {} |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 151 | 116 | : _data(data), | 152 | 116 | _options(options), | 153 | 116 | _parsed(false), | 154 | 116 | _num_elems(0), | 155 | 116 | _offsets_pos(0), | 156 | 116 | _cur_idx(0) {} |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 151 | 76 | : _data(data), | 152 | 76 | _options(options), | 153 | 76 | _parsed(false), | 154 | 76 | _num_elems(0), | 155 | 76 | _offsets_pos(0), | 156 | 76 | _cur_idx(0) {} |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 151 | 64 | : _data(data), | 152 | 64 | _options(options), | 153 | 64 | _parsed(false), | 154 | 64 | _num_elems(0), | 155 | 64 | _offsets_pos(0), | 156 | 64 | _cur_idx(0) {} |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 151 | 526 | : _data(data), | 152 | 526 | _options(options), | 153 | 526 | _parsed(false), | 154 | 526 | _num_elems(0), | 155 | 526 | _offsets_pos(0), | 156 | 526 | _cur_idx(0) {} |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 151 | 36 | : _data(data), | 152 | 36 | _options(options), | 153 | 36 | _parsed(false), | 154 | 36 | _num_elems(0), | 155 | 36 | _offsets_pos(0), | 156 | 36 | _cur_idx(0) {} |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 151 | 228 | : _data(data), | 152 | 228 | _options(options), | 153 | 228 | _parsed(false), | 154 | 228 | _num_elems(0), | 155 | 228 | _offsets_pos(0), | 156 | 228 | _cur_idx(0) {} |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EEC2ENS_5SliceERKNS0_18PageDecoderOptionsE Line | Count | Source | 151 | 32 | : _data(data), | 152 | 32 | _options(options), | 153 | 32 | _parsed(false), | 154 | 32 | _num_elems(0), | 155 | 32 | _offsets_pos(0), | 156 | 32 | _cur_idx(0) {} |
|
157 | | |
158 | 13.3k | Status init() override { |
159 | 13.3k | CHECK(!_parsed); |
160 | | |
161 | 13.3k | 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 | 13.3k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); |
170 | 13.3k | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); |
171 | | |
172 | 13.3k | 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 | 13.3k | _parsed = true; |
179 | | |
180 | 13.3k | return Status::OK(); |
181 | 13.3k | } _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE4initEv Line | Count | Source | 158 | 5.99k | Status init() override { | 159 | 5.99k | CHECK(!_parsed); | 160 | | | 161 | 5.99k | 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 | 5.99k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 170 | 5.99k | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 171 | | | 172 | 5.99k | 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 | 5.99k | _parsed = true; | 179 | | | 180 | 5.99k | return Status::OK(); | 181 | 5.99k | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE4initEv Line | Count | Source | 158 | 6.29k | Status init() override { | 159 | 6.29k | CHECK(!_parsed); | 160 | | | 161 | 6.29k | 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.29k | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 170 | 6.29k | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 171 | | | 172 | 6.29k | 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.29k | _parsed = true; | 179 | | | 180 | 6.29k | return Status::OK(); | 181 | 6.29k | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE4initEv Line | Count | Source | 158 | 116 | Status init() override { | 159 | 116 | CHECK(!_parsed); | 160 | | | 161 | 116 | 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 | 116 | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 170 | 116 | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 171 | | | 172 | 116 | 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 | 116 | _parsed = true; | 179 | | | 180 | 116 | return Status::OK(); | 181 | 116 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE4initEv Line | Count | Source | 158 | 76 | Status init() override { | 159 | 76 | CHECK(!_parsed); | 160 | | | 161 | 76 | 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 | 76 | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 170 | 76 | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 171 | | | 172 | 76 | 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 | 76 | _parsed = true; | 179 | | | 180 | 76 | return Status::OK(); | 181 | 76 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE4initEv Line | Count | Source | 158 | 64 | Status init() override { | 159 | 64 | CHECK(!_parsed); | 160 | | | 161 | 64 | 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 | 64 | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 170 | 64 | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 171 | | | 172 | 64 | 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 | 64 | _parsed = true; | 179 | | | 180 | 64 | return Status::OK(); | 181 | 64 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE4initEv Line | Count | Source | 158 | 526 | Status init() override { | 159 | 526 | CHECK(!_parsed); | 160 | | | 161 | 526 | 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 | 526 | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 170 | 526 | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 171 | | | 172 | 526 | 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 | 526 | _parsed = true; | 179 | | | 180 | 526 | return Status::OK(); | 181 | 526 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE4initEv Line | Count | Source | 158 | 36 | Status init() override { | 159 | 36 | CHECK(!_parsed); | 160 | | | 161 | 36 | 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 | 36 | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 170 | 36 | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 171 | | | 172 | 36 | 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 | 36 | _parsed = true; | 179 | | | 180 | 36 | return Status::OK(); | 181 | 36 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE4initEv Line | Count | Source | 158 | 228 | Status init() override { | 159 | 228 | CHECK(!_parsed); | 160 | | | 161 | 228 | 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 | 228 | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 170 | 228 | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 171 | | | 172 | 228 | 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 | 228 | _parsed = true; | 179 | | | 180 | 228 | return Status::OK(); | 181 | 228 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE4initEv Line | Count | Source | 158 | 32 | Status init() override { | 159 | 32 | CHECK(!_parsed); | 160 | | | 161 | 32 | 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 | 32 | _num_elems = decode_fixed32_le((const uint8_t*)&_data[_data.get_size() - sizeof(uint32_t)]); | 170 | 32 | _offsets_pos = cast_set<uint32_t>(_data.get_size() - ((_num_elems + 1) * sizeof(uint32_t))); | 171 | | | 172 | 32 | 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 | 32 | _parsed = true; | 179 | | | 180 | 32 | return Status::OK(); | 181 | 32 | } |
|
182 | | |
183 | 1.16k | Status seek_to_position_in_page(size_t pos) override { |
184 | 1.16k | 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 | 1.16k | DCHECK_LE(pos, _num_elems); |
191 | 1.16k | _cur_idx = pos; |
192 | 1.16k | return Status::OK(); |
193 | 1.16k | } _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE24seek_to_position_in_pageEm Line | Count | Source | 183 | 842 | Status seek_to_position_in_page(size_t pos) override { | 184 | 842 | 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 | 842 | DCHECK_LE(pos, _num_elems); | 191 | 842 | _cur_idx = pos; | 192 | 842 | return Status::OK(); | 193 | 842 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE24seek_to_position_in_pageEm Line | Count | Source | 183 | 28 | Status seek_to_position_in_page(size_t pos) override { | 184 | 28 | 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 | 28 | DCHECK_LE(pos, _num_elems); | 191 | 28 | _cur_idx = pos; | 192 | 28 | return Status::OK(); | 193 | 28 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE24seek_to_position_in_pageEm Line | Count | Source | 183 | 8 | Status seek_to_position_in_page(size_t pos) override { | 184 | 8 | 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 | 8 | DCHECK_LE(pos, _num_elems); | 191 | 8 | _cur_idx = pos; | 192 | 8 | return Status::OK(); | 193 | 8 | } |
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 | 286 | Status seek_to_position_in_page(size_t pos) override { | 184 | 286 | 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 | 286 | DCHECK_LE(pos, _num_elems); | 191 | 286 | _cur_idx = pos; | 192 | 286 | return Status::OK(); | 193 | 286 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE24seek_to_position_in_pageEm |
194 | | |
195 | 4.91k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { |
196 | 4.91k | DCHECK(_parsed); |
197 | 4.91k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { |
198 | 6 | *n = 0; |
199 | 6 | return Status::OK(); |
200 | 6 | } |
201 | 4.91k | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); |
202 | | |
203 | 4.91k | 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 | 4.91k | uint32_t last_offset = guarded_offset(_cur_idx); |
219 | 4.91k | _offsets.resize(max_fetch + 1); |
220 | 4.91k | _offsets[0] = last_offset; |
221 | 921k | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { |
222 | 916k | const uint32_t start_offset = last_offset; |
223 | 916k | last_offset = guarded_offset(_cur_idx + 1); |
224 | 916k | _offsets[i + 1] = last_offset; |
225 | 916k | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { |
226 | 260 | if (_options.need_check_bitmap) { |
227 | 260 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset))); |
228 | 260 | } |
229 | 260 | } |
230 | 916k | } |
231 | 4.91k | _cur_idx++; |
232 | 4.91k | _offsets[max_fetch] = offset(_cur_idx); |
233 | 4.91k | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { |
234 | 324 | if (_options.need_check_bitmap) { |
235 | 38 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset))); |
236 | 38 | } |
237 | 324 | } |
238 | 324 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); |
239 | | |
240 | 4.91k | *n = max_fetch; |
241 | 4.91k | return Status::OK(); |
242 | 4.91k | } _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 195 | 3.89k | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 196 | 3.89k | DCHECK(_parsed); | 197 | 3.89k | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 198 | 4 | *n = 0; | 199 | 4 | return Status::OK(); | 200 | 4 | } | 201 | 3.88k | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 202 | | | 203 | 3.88k | 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 | 3.88k | uint32_t last_offset = guarded_offset(_cur_idx); | 219 | 3.88k | _offsets.resize(max_fetch + 1); | 220 | 3.88k | _offsets[0] = last_offset; | 221 | 914k | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 222 | 910k | const uint32_t start_offset = last_offset; | 223 | 910k | last_offset = guarded_offset(_cur_idx + 1); | 224 | 910k | _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 | 910k | } | 231 | 3.88k | _cur_idx++; | 232 | 3.88k | _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 | 3.88k | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 239 | | | 240 | 3.88k | *n = max_fetch; | 241 | 3.88k | return Status::OK(); | 242 | 3.88k | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 195 | 206 | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 196 | 206 | DCHECK(_parsed); | 197 | 206 | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 198 | 2 | *n = 0; | 199 | 2 | return Status::OK(); | 200 | 2 | } | 201 | 204 | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 202 | | | 203 | 204 | 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 | 204 | uint32_t last_offset = guarded_offset(_cur_idx); | 219 | 204 | _offsets.resize(max_fetch + 1); | 220 | 204 | _offsets[0] = last_offset; | 221 | 1.43k | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 222 | 1.22k | const uint32_t start_offset = last_offset; | 223 | 1.22k | last_offset = guarded_offset(_cur_idx + 1); | 224 | 1.22k | _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 | 1.22k | } | 231 | 204 | _cur_idx++; | 232 | 204 | _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 | 204 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 239 | | | 240 | 204 | *n = max_fetch; | 241 | 204 | return Status::OK(); | 242 | 204 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 195 | 186 | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 196 | 186 | DCHECK(_parsed); | 197 | 186 | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 198 | 0 | *n = 0; | 199 | 0 | return Status::OK(); | 200 | 0 | } | 201 | 186 | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 202 | | | 203 | 186 | 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 | 186 | uint32_t last_offset = guarded_offset(_cur_idx); | 219 | 186 | _offsets.resize(max_fetch + 1); | 220 | 186 | _offsets[0] = last_offset; | 221 | 1.36k | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 222 | 1.17k | const uint32_t start_offset = last_offset; | 223 | 1.17k | last_offset = guarded_offset(_cur_idx + 1); | 224 | 1.17k | _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 | 1.17k | } | 231 | 186 | _cur_idx++; | 232 | 186 | _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 | 186 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 239 | | | 240 | 186 | *n = max_fetch; | 241 | 186 | return Status::OK(); | 242 | 186 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 195 | 76 | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 196 | 76 | DCHECK(_parsed); | 197 | 76 | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 198 | 0 | *n = 0; | 199 | 0 | return Status::OK(); | 200 | 0 | } | 201 | 76 | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 202 | | | 203 | 76 | 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 | 76 | uint32_t last_offset = guarded_offset(_cur_idx); | 219 | 76 | _offsets.resize(max_fetch + 1); | 220 | 76 | _offsets[0] = last_offset; | 221 | 1.44k | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 222 | 1.37k | const uint32_t start_offset = last_offset; | 223 | 1.37k | last_offset = guarded_offset(_cur_idx + 1); | 224 | 1.37k | _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 | 1.37k | } | 231 | 76 | _cur_idx++; | 232 | 76 | _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 | 76 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 239 | | | 240 | 76 | *n = max_fetch; | 241 | 76 | return Status::OK(); | 242 | 76 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 195 | 164 | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 196 | 164 | DCHECK(_parsed); | 197 | 164 | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 198 | 0 | *n = 0; | 199 | 0 | return Status::OK(); | 200 | 0 | } | 201 | 164 | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 202 | | | 203 | 164 | 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 | 164 | uint32_t last_offset = guarded_offset(_cur_idx); | 219 | 164 | _offsets.resize(max_fetch + 1); | 220 | 164 | _offsets[0] = last_offset; | 221 | 1.29k | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 222 | 1.12k | const uint32_t start_offset = last_offset; | 223 | 1.12k | last_offset = guarded_offset(_cur_idx + 1); | 224 | 1.12k | _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 | 1.12k | } | 231 | 164 | _cur_idx++; | 232 | 164 | _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 | 164 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 239 | | | 240 | 164 | *n = max_fetch; | 241 | 164 | return Status::OK(); | 242 | 164 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 195 | 36 | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 196 | 36 | DCHECK(_parsed); | 197 | 36 | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 198 | 0 | *n = 0; | 199 | 0 | return Status::OK(); | 200 | 0 | } | 201 | 36 | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 202 | | | 203 | 36 | 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 | 36 | uint32_t last_offset = guarded_offset(_cur_idx); | 219 | 36 | _offsets.resize(max_fetch + 1); | 220 | 36 | _offsets[0] = last_offset; | 221 | 240 | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 222 | 204 | const uint32_t start_offset = last_offset; | 223 | 204 | last_offset = guarded_offset(_cur_idx + 1); | 224 | 204 | _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 | 204 | } | 231 | 36 | _cur_idx++; | 232 | 36 | _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 | 36 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 239 | | | 240 | 36 | *n = max_fetch; | 241 | 36 | return Status::OK(); | 242 | 36 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 195 | 324 | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 196 | 324 | DCHECK(_parsed); | 197 | 324 | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 198 | 0 | *n = 0; | 199 | 0 | return Status::OK(); | 200 | 0 | } | 201 | 324 | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 202 | | | 203 | 324 | 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 | 324 | uint32_t last_offset = guarded_offset(_cur_idx); | 219 | 324 | _offsets.resize(max_fetch + 1); | 220 | 324 | _offsets[0] = last_offset; | 221 | 584 | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 222 | 260 | const uint32_t start_offset = last_offset; | 223 | 260 | last_offset = guarded_offset(_cur_idx + 1); | 224 | 260 | _offsets[i + 1] = last_offset; | 225 | 260 | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 226 | 260 | if (_options.need_check_bitmap) { | 227 | 260 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + start_offset))); | 228 | 260 | } | 229 | 260 | } | 230 | 260 | } | 231 | 324 | _cur_idx++; | 232 | 324 | _offsets[max_fetch] = offset(_cur_idx); | 233 | 324 | if constexpr (Type == FieldType::OLAP_FIELD_TYPE_BITMAP) { | 234 | 324 | if (_options.need_check_bitmap) { | 235 | 38 | RETURN_IF_ERROR(BitmapTypeCode::validate(*(_data.data + last_offset))); | 236 | 38 | } | 237 | 324 | } | 238 | 324 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 239 | | | 240 | 324 | *n = max_fetch; | 241 | 324 | return Status::OK(); | 242 | 324 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE10next_batchEPmRNS_3COWINS_7IColumnEE11mutable_ptrIS6_EE Line | Count | Source | 195 | 32 | Status next_batch(size_t* n, MutableColumnPtr& dst) override { | 196 | 32 | DCHECK(_parsed); | 197 | 32 | if (*n == 0 || _cur_idx >= _num_elems) [[unlikely]] { | 198 | 0 | *n = 0; | 199 | 0 | return Status::OK(); | 200 | 0 | } | 201 | 32 | const size_t max_fetch = std::min(*n, static_cast<size_t>(_num_elems - _cur_idx)); | 202 | | | 203 | 32 | 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 | 32 | uint32_t last_offset = guarded_offset(_cur_idx); | 219 | 32 | _offsets.resize(max_fetch + 1); | 220 | 32 | _offsets[0] = last_offset; | 221 | 720 | for (int i = 0; i < max_fetch - 1; i++, _cur_idx++) { | 222 | 688 | const uint32_t start_offset = last_offset; | 223 | 688 | last_offset = guarded_offset(_cur_idx + 1); | 224 | 688 | _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 | 688 | } | 231 | 32 | _cur_idx++; | 232 | 32 | _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 | 32 | dst->insert_many_continuous_binary_data(_data.data, _offsets.data(), max_fetch); | 239 | | | 240 | 32 | *n = max_fetch; | 241 | 32 | return Status::OK(); | 242 | 32 | } |
|
243 | | |
244 | | Status read_by_rowids(const rowid_t* rowids, ordinal_t page_first_ordinal, size_t* n, |
245 | 1.17k | MutableColumnPtr& dst) override { |
246 | 1.17k | DCHECK(_parsed); |
247 | 1.17k | if (*n == 0) [[unlikely]] { |
248 | 0 | *n = 0; |
249 | 0 | return Status::OK(); |
250 | 0 | } |
251 | | |
252 | 1.17k | auto total = *n; |
253 | | |
254 | 1.17k | 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.17k | size_t read_count = 0; |
277 | 1.17k | _binary_data.resize(total); |
278 | 5.16k | for (size_t i = 0; i < total; ++i) { |
279 | 3.99k | ordinal_t ord = rowids[i] - page_first_ordinal; |
280 | 3.99k | if (UNLIKELY(ord >= _num_elems)) { |
281 | 0 | break; |
282 | 0 | } |
283 | | |
284 | 3.99k | const uint32_t start_offset = offset(ord); |
285 | 3.99k | _binary_data[read_count].data = _data.mutable_data() + start_offset; |
286 | 3.99k | _binary_data[read_count].size = offset(ord + 1) - start_offset; |
287 | 3.99k | read_count++; |
288 | 3.99k | } |
289 | | |
290 | 1.17k | if (LIKELY(read_count > 0)) { |
291 | 1.17k | dst->insert_many_strings(_binary_data.data(), read_count); |
292 | 1.17k | } |
293 | | |
294 | 1.17k | *n = read_count; |
295 | 1.17k | return Status::OK(); |
296 | 1.17k | } _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 245 | 1.11k | MutableColumnPtr& dst) override { | 246 | 1.11k | DCHECK(_parsed); | 247 | 1.11k | if (*n == 0) [[unlikely]] { | 248 | 0 | *n = 0; | 249 | 0 | return Status::OK(); | 250 | 0 | } | 251 | | | 252 | 1.11k | auto total = *n; | 253 | | | 254 | 1.11k | 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.11k | size_t read_count = 0; | 277 | 1.11k | _binary_data.resize(total); | 278 | 5.01k | for (size_t i = 0; i < total; ++i) { | 279 | 3.90k | ordinal_t ord = rowids[i] - page_first_ordinal; | 280 | 3.90k | if (UNLIKELY(ord >= _num_elems)) { | 281 | 0 | break; | 282 | 0 | } | 283 | | | 284 | 3.90k | const uint32_t start_offset = offset(ord); | 285 | 3.90k | _binary_data[read_count].data = _data.mutable_data() + start_offset; | 286 | 3.90k | _binary_data[read_count].size = offset(ord + 1) - start_offset; | 287 | 3.90k | read_count++; | 288 | 3.90k | } | 289 | | | 290 | 1.11k | if (LIKELY(read_count > 0)) { | 291 | 1.11k | dst->insert_many_strings(_binary_data.data(), read_count); | 292 | 1.11k | } | 293 | | | 294 | 1.11k | *n = read_count; | 295 | 1.11k | return Status::OK(); | 296 | 1.11k | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 245 | 50 | MutableColumnPtr& dst) override { | 246 | 50 | DCHECK(_parsed); | 247 | 50 | if (*n == 0) [[unlikely]] { | 248 | 0 | *n = 0; | 249 | 0 | return Status::OK(); | 250 | 0 | } | 251 | | | 252 | 50 | auto total = *n; | 253 | | | 254 | 50 | 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 | 50 | size_t read_count = 0; | 277 | 50 | _binary_data.resize(total); | 278 | 122 | for (size_t i = 0; i < total; ++i) { | 279 | 72 | ordinal_t ord = rowids[i] - page_first_ordinal; | 280 | 72 | if (UNLIKELY(ord >= _num_elems)) { | 281 | 0 | break; | 282 | 0 | } | 283 | | | 284 | 72 | const uint32_t start_offset = offset(ord); | 285 | 72 | _binary_data[read_count].data = _data.mutable_data() + start_offset; | 286 | 72 | _binary_data[read_count].size = offset(ord + 1) - start_offset; | 287 | 72 | read_count++; | 288 | 72 | } | 289 | | | 290 | 50 | if (LIKELY(read_count > 0)) { | 291 | 50 | dst->insert_many_strings(_binary_data.data(), read_count); | 292 | 50 | } | 293 | | | 294 | 50 | *n = read_count; | 295 | 50 | return Status::OK(); | 296 | 50 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE Line | Count | Source | 245 | 2 | MutableColumnPtr& dst) override { | 246 | 2 | DCHECK(_parsed); | 247 | 2 | if (*n == 0) [[unlikely]] { | 248 | 0 | *n = 0; | 249 | 0 | return Status::OK(); | 250 | 0 | } | 251 | | | 252 | 2 | auto total = *n; | 253 | | | 254 | 2 | 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 | 2 | size_t read_count = 0; | 277 | 2 | _binary_data.resize(total); | 278 | 10 | for (size_t i = 0; i < total; ++i) { | 279 | 8 | ordinal_t ord = rowids[i] - page_first_ordinal; | 280 | 8 | if (UNLIKELY(ord >= _num_elems)) { | 281 | 0 | break; | 282 | 0 | } | 283 | | | 284 | 8 | const uint32_t start_offset = offset(ord); | 285 | 8 | _binary_data[read_count].data = _data.mutable_data() + start_offset; | 286 | 8 | _binary_data[read_count].size = offset(ord + 1) - start_offset; | 287 | 8 | read_count++; | 288 | 8 | } | 289 | | | 290 | 2 | if (LIKELY(read_count > 0)) { | 291 | 2 | dst->insert_many_strings(_binary_data.data(), read_count); | 292 | 2 | } | 293 | | | 294 | 2 | *n = read_count; | 295 | 2 | return Status::OK(); | 296 | 2 | } |
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 | 8 | MutableColumnPtr& dst) override { | 246 | 8 | DCHECK(_parsed); | 247 | 8 | if (*n == 0) [[unlikely]] { | 248 | 0 | *n = 0; | 249 | 0 | return Status::OK(); | 250 | 0 | } | 251 | | | 252 | 8 | auto total = *n; | 253 | | | 254 | 8 | 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 | 8 | size_t read_count = 0; | 277 | 8 | _binary_data.resize(total); | 278 | 16 | for (size_t i = 0; i < total; ++i) { | 279 | 8 | ordinal_t ord = rowids[i] - page_first_ordinal; | 280 | 8 | if (UNLIKELY(ord >= _num_elems)) { | 281 | 0 | break; | 282 | 0 | } | 283 | | | 284 | 8 | const uint32_t start_offset = offset(ord); | 285 | 8 | _binary_data[read_count].data = _data.mutable_data() + start_offset; | 286 | 8 | _binary_data[read_count].size = offset(ord + 1) - start_offset; | 287 | 8 | read_count++; | 288 | 8 | } | 289 | | | 290 | 8 | if (LIKELY(read_count > 0)) { | 291 | 8 | dst->insert_many_strings(_binary_data.data(), read_count); | 292 | 8 | } | 293 | | | 294 | 8 | *n = read_count; | 295 | 8 | return Status::OK(); | 296 | 8 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE14read_by_rowidsEPKjmPmRNS_3COWINS_7IColumnEE11mutable_ptrIS8_EE |
297 | | |
298 | 16.2k | size_t count() const override { |
299 | 16.2k | DCHECK(_parsed); |
300 | 16.2k | return _num_elems; |
301 | 16.2k | } _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE5countEv Line | Count | Source | 298 | 2.64k | size_t count() const override { | 299 | | DCHECK(_parsed); | 300 | 2.64k | return _num_elems; | 301 | 2.64k | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE5countEv Line | Count | Source | 298 | 12.3k | size_t count() const override { | 299 | | DCHECK(_parsed); | 300 | 12.3k | return _num_elems; | 301 | 12.3k | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE5countEv Line | Count | Source | 298 | 114 | size_t count() const override { | 299 | | DCHECK(_parsed); | 300 | 114 | return _num_elems; | 301 | 114 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE5countEv Line | Count | Source | 298 | 2 | size_t count() const override { | 299 | | DCHECK(_parsed); | 300 | 2 | return _num_elems; | 301 | 2 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE5countEv Line | Count | Source | 298 | 32 | size_t count() const override { | 299 | | DCHECK(_parsed); | 300 | 32 | return _num_elems; | 301 | 32 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE5countEv Line | Count | Source | 298 | 1.07k | size_t count() const override { | 299 | | DCHECK(_parsed); | 300 | 1.07k | return _num_elems; | 301 | 1.07k | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE5countEv Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE5countEv |
302 | | |
303 | 848 | size_t current_index() const override { |
304 | 848 | DCHECK(_parsed); |
305 | 848 | return _cur_idx; |
306 | 848 | } _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE13current_indexEv Line | Count | Source | 303 | 546 | size_t current_index() const override { | 304 | | DCHECK(_parsed); | 305 | 546 | return _cur_idx; | 306 | 546 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE13current_indexEv Line | Count | Source | 303 | 8 | size_t current_index() const override { | 304 | | DCHECK(_parsed); | 305 | 8 | return _cur_idx; | 306 | 8 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE13current_indexEv Line | Count | Source | 303 | 8 | size_t current_index() const override { | 304 | | DCHECK(_parsed); | 305 | 8 | return _cur_idx; | 306 | 8 | } |
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 | 286 | size_t current_index() const override { | 304 | | DCHECK(_parsed); | 305 | 286 | return _cur_idx; | 306 | 286 | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE13current_indexEv |
307 | | |
308 | 8.03k | Status get_dict_word_info(StringRef* dict_word_info) override { |
309 | 8.03k | if (UNLIKELY(_num_elems <= 0)) { |
310 | 6 | return Status::OK(); |
311 | 6 | } |
312 | | |
313 | 8.03k | char* data_begin = (char*)&_data[0]; |
314 | 8.03k | char* offset_ptr = (char*)&_data[_offsets_pos]; |
315 | | |
316 | 176k | for (uint32_t i = 0; i < _num_elems; ++i) { |
317 | 168k | uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr); |
318 | 168k | 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 | 168k | dict_word_info[i].data = data_begin + offset; |
325 | 168k | offset_ptr += sizeof(uint32_t); |
326 | 168k | } |
327 | | |
328 | 168k | for (int i = 0; i < (int)_num_elems - 1; ++i) { |
329 | 160k | dict_word_info[i].size = |
330 | 160k | (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data; |
331 | 160k | } |
332 | | |
333 | 8.03k | dict_word_info[_num_elems - 1].size = |
334 | 8.03k | (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data; |
335 | 8.03k | return Status::OK(); |
336 | 8.03k | } _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE18get_dict_word_infoEPNS_9StringRefE Line | Count | Source | 308 | 1.29k | Status get_dict_word_info(StringRef* dict_word_info) override { | 309 | 1.29k | if (UNLIKELY(_num_elems <= 0)) { | 310 | 0 | return Status::OK(); | 311 | 0 | } | 312 | | | 313 | 1.29k | char* data_begin = (char*)&_data[0]; | 314 | 1.29k | char* offset_ptr = (char*)&_data[_offsets_pos]; | 315 | | | 316 | 12.3k | for (uint32_t i = 0; i < _num_elems; ++i) { | 317 | 11.0k | uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr); | 318 | 11.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 | 11.0k | dict_word_info[i].data = data_begin + offset; | 325 | 11.0k | offset_ptr += sizeof(uint32_t); | 326 | 11.0k | } | 327 | | | 328 | 11.0k | for (int i = 0; i < (int)_num_elems - 1; ++i) { | 329 | 9.79k | dict_word_info[i].size = | 330 | 9.79k | (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data; | 331 | 9.79k | } | 332 | | | 333 | 1.29k | dict_word_info[_num_elems - 1].size = | 334 | 1.29k | (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data; | 335 | 1.29k | return Status::OK(); | 336 | 1.29k | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE18get_dict_word_infoEPNS_9StringRefE Line | Count | Source | 308 | 6.15k | Status get_dict_word_info(StringRef* dict_word_info) override { | 309 | 6.15k | if (UNLIKELY(_num_elems <= 0)) { | 310 | 4 | return Status::OK(); | 311 | 4 | } | 312 | | | 313 | 6.15k | char* data_begin = (char*)&_data[0]; | 314 | 6.15k | char* offset_ptr = (char*)&_data[_offsets_pos]; | 315 | | | 316 | 155k | for (uint32_t i = 0; i < _num_elems; ++i) { | 317 | 149k | uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr); | 318 | 149k | 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 | 149k | dict_word_info[i].data = data_begin + offset; | 325 | 149k | offset_ptr += sizeof(uint32_t); | 326 | 149k | } | 327 | | | 328 | 149k | for (int i = 0; i < (int)_num_elems - 1; ++i) { | 329 | 143k | dict_word_info[i].size = | 330 | 143k | (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data; | 331 | 143k | } | 332 | | | 333 | 6.15k | dict_word_info[_num_elems - 1].size = | 334 | 6.15k | (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data; | 335 | 6.15k | return Status::OK(); | 336 | 6.15k | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE18get_dict_word_infoEPNS_9StringRefE Line | Count | Source | 308 | 48 | Status get_dict_word_info(StringRef* dict_word_info) override { | 309 | 48 | if (UNLIKELY(_num_elems <= 0)) { | 310 | 0 | return Status::OK(); | 311 | 0 | } | 312 | | | 313 | 48 | char* data_begin = (char*)&_data[0]; | 314 | 48 | char* offset_ptr = (char*)&_data[_offsets_pos]; | 315 | | | 316 | 3.35k | for (uint32_t i = 0; i < _num_elems; ++i) { | 317 | 3.30k | uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr); | 318 | 3.30k | 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 | 3.30k | dict_word_info[i].data = data_begin + offset; | 325 | 3.30k | offset_ptr += sizeof(uint32_t); | 326 | 3.30k | } | 327 | | | 328 | 3.30k | for (int i = 0; i < (int)_num_elems - 1; ++i) { | 329 | 3.25k | dict_word_info[i].size = | 330 | 3.25k | (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data; | 331 | 3.25k | } | 332 | | | 333 | 48 | dict_word_info[_num_elems - 1].size = | 334 | 48 | (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data; | 335 | 48 | return Status::OK(); | 336 | 48 | } |
Unexecuted instantiation: _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE18get_dict_word_infoEPNS_9StringRefE _ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE18get_dict_word_infoEPNS_9StringRefE Line | Count | Source | 308 | 14 | Status get_dict_word_info(StringRef* dict_word_info) override { | 309 | 14 | if (UNLIKELY(_num_elems <= 0)) { | 310 | 0 | return Status::OK(); | 311 | 0 | } | 312 | | | 313 | 14 | char* data_begin = (char*)&_data[0]; | 314 | 14 | char* offset_ptr = (char*)&_data[_offsets_pos]; | 315 | | | 316 | 4.11k | for (uint32_t i = 0; i < _num_elems; ++i) { | 317 | 4.10k | uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr); | 318 | 4.10k | 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.10k | dict_word_info[i].data = data_begin + offset; | 325 | 4.10k | offset_ptr += sizeof(uint32_t); | 326 | 4.10k | } | 327 | | | 328 | 4.10k | for (int i = 0; i < (int)_num_elems - 1; ++i) { | 329 | 4.09k | dict_word_info[i].size = | 330 | 4.09k | (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data; | 331 | 4.09k | } | 332 | | | 333 | 14 | dict_word_info[_num_elems - 1].size = | 334 | 14 | (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data; | 335 | 14 | return Status::OK(); | 336 | 14 | } |
_ZN5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE18get_dict_word_infoEPNS_9StringRefE Line | Count | Source | 308 | 526 | Status get_dict_word_info(StringRef* dict_word_info) override { | 309 | 526 | if (UNLIKELY(_num_elems <= 0)) { | 310 | 2 | return Status::OK(); | 311 | 2 | } | 312 | | | 313 | 524 | char* data_begin = (char*)&_data[0]; | 314 | 524 | char* offset_ptr = (char*)&_data[_offsets_pos]; | 315 | | | 316 | 1.10k | for (uint32_t i = 0; i < _num_elems; ++i) { | 317 | 576 | uint32_t offset = decode_fixed32_le((uint8_t*)offset_ptr); | 318 | 576 | 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 | 576 | dict_word_info[i].data = data_begin + offset; | 325 | 576 | offset_ptr += sizeof(uint32_t); | 326 | 576 | } | 327 | | | 328 | 576 | for (int i = 0; i < (int)_num_elems - 1; ++i) { | 329 | 52 | dict_word_info[i].size = | 330 | 52 | (char*)dict_word_info[i + 1].data - (char*)dict_word_info[i].data; | 331 | 52 | } | 332 | | | 333 | 524 | dict_word_info[_num_elems - 1].size = | 334 | 524 | (data_begin + _offsets_pos) - (char*)dict_word_info[_num_elems - 1].data; | 335 | 524 | return Status::OK(); | 336 | 524 | } |
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 | 12.8k | uint32_t offset(size_t idx) const { |
342 | 12.8k | if (idx >= _num_elems) { |
343 | 5.24k | return _offsets_pos; |
344 | 5.24k | } |
345 | 7.64k | return guarded_offset(idx); |
346 | 12.8k | } _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE6offsetEm Line | Count | Source | 341 | 11.6k | uint32_t offset(size_t idx) const { | 342 | 11.6k | if (idx >= _num_elems) { | 343 | 4.63k | return _offsets_pos; | 344 | 4.63k | } | 345 | 7.06k | return guarded_offset(idx); | 346 | 11.6k | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE6offsetEm Line | Count | Source | 341 | 348 | uint32_t offset(size_t idx) const { | 342 | 348 | if (idx >= _num_elems) { | 343 | 122 | return _offsets_pos; | 344 | 122 | } | 345 | 226 | return guarded_offset(idx); | 346 | 348 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE6offsetEm Line | Count | Source | 341 | 202 | uint32_t offset(size_t idx) const { | 342 | 202 | if (idx >= _num_elems) { | 343 | 68 | return _offsets_pos; | 344 | 68 | } | 345 | 134 | return guarded_offset(idx); | 346 | 202 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE6offsetEm Line | Count | Source | 341 | 76 | uint32_t offset(size_t idx) const { | 342 | 76 | if (idx >= _num_elems) { | 343 | 76 | return _offsets_pos; | 344 | 76 | } | 345 | 0 | return guarded_offset(idx); | 346 | 76 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE6offsetEm Line | Count | Source | 341 | 164 | uint32_t offset(size_t idx) const { | 342 | 164 | if (idx >= _num_elems) { | 343 | 50 | return _offsets_pos; | 344 | 50 | } | 345 | 114 | return guarded_offset(idx); | 346 | 164 | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE6offsetEm _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE6offsetEm Line | Count | Source | 341 | 36 | uint32_t offset(size_t idx) const { | 342 | 36 | if (idx >= _num_elems) { | 343 | 36 | return _offsets_pos; | 344 | 36 | } | 345 | 0 | return guarded_offset(idx); | 346 | 36 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE6offsetEm Line | Count | Source | 341 | 340 | uint32_t offset(size_t idx) const { | 342 | 340 | if (idx >= _num_elems) { | 343 | 228 | return _offsets_pos; | 344 | 228 | } | 345 | 112 | return guarded_offset(idx); | 346 | 340 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE6offsetEm Line | Count | Source | 341 | 32 | uint32_t offset(size_t idx) const { | 342 | 32 | if (idx >= _num_elems) { | 343 | 32 | return _offsets_pos; | 344 | 32 | } | 345 | 0 | return guarded_offset(idx); | 346 | 32 | } |
|
347 | | |
348 | 929k | uint32_t guarded_offset(size_t idx) const { |
349 | 929k | const auto* p = |
350 | 929k | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); |
351 | 929k | return decode_fixed32_le(p); |
352 | 929k | } _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE17EE14guarded_offsetEm Line | Count | Source | 348 | 921k | uint32_t guarded_offset(size_t idx) const { | 349 | 921k | const auto* p = | 350 | 921k | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 351 | 921k | return decode_fixed32_le(p); | 352 | 921k | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE26EE14guarded_offsetEm Line | Count | Source | 348 | 1.65k | uint32_t guarded_offset(size_t idx) const { | 349 | 1.65k | const auto* p = | 350 | 1.65k | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 351 | 1.65k | return decode_fixed32_le(p); | 352 | 1.65k | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE13EE14guarded_offsetEm Line | Count | Source | 348 | 1.49k | uint32_t guarded_offset(size_t idx) const { | 349 | 1.49k | const auto* p = | 350 | 1.49k | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 351 | 1.49k | return decode_fixed32_le(p); | 352 | 1.49k | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE36EE14guarded_offsetEm Line | Count | Source | 348 | 1.44k | uint32_t guarded_offset(size_t idx) const { | 349 | 1.44k | const auto* p = | 350 | 1.44k | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 351 | 1.44k | return decode_fixed32_le(p); | 352 | 1.44k | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE34EE14guarded_offsetEm Line | Count | Source | 348 | 1.40k | uint32_t guarded_offset(size_t idx) const { | 349 | 1.40k | const auto* p = | 350 | 1.40k | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 351 | 1.40k | return decode_fixed32_le(p); | 352 | 1.40k | } |
Unexecuted instantiation: _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE35EE14guarded_offsetEm _ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE23EE14guarded_offsetEm Line | Count | Source | 348 | 240 | uint32_t guarded_offset(size_t idx) const { | 349 | 240 | const auto* p = | 350 | 240 | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 351 | 240 | return decode_fixed32_le(p); | 352 | 240 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE25EE14guarded_offsetEm Line | Count | Source | 348 | 696 | uint32_t guarded_offset(size_t idx) const { | 349 | 696 | const auto* p = | 350 | 696 | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 351 | 696 | return decode_fixed32_le(p); | 352 | 696 | } |
_ZNK5doris10segment_v222BinaryPlainPageDecoderILNS_9FieldTypeE27EE14guarded_offsetEm Line | Count | Source | 348 | 720 | uint32_t guarded_offset(size_t idx) const { | 349 | 720 | const auto* p = | 350 | 720 | reinterpret_cast<const uint8_t*>(&_data[_offsets_pos + idx * SIZE_OF_INT32]); | 351 | 720 | return decode_fixed32_le(p); | 352 | 720 | } |
|
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 |