Coverage Report

Created: 2026-08-02 13:15

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/storage/segment/encoding_info.cpp
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
#include "storage/segment/encoding_info.h"
19
20
#include <gen_cpp/olap_file.pb.h>
21
#include <gen_cpp/segment_v2.pb.h>
22
23
#include <array>
24
#include <iterator>
25
#include <type_traits>
26
#include <unordered_map>
27
#include <utility>
28
29
#include "common/config.h"
30
#include "common/exception.h"
31
#include "runtime/exec_env.h"
32
#include "storage/olap_common.h"
33
#include "storage/segment/binary_dict_page.h"
34
#include "storage/segment/binary_dict_page_pre_decoder.h"
35
#include "storage/segment/binary_plain_page.h"
36
#include "storage/segment/binary_plain_page_char_strip_pre_decoder.h"
37
#include "storage/segment/binary_plain_page_v2.h"
38
#include "storage/segment/binary_plain_page_v2_pre_decoder.h"
39
#include "storage/segment/binary_plain_page_v3.h"
40
#include "storage/segment/binary_plain_page_v3_pre_decoder.h"
41
#include "storage/segment/binary_prefix_page.h"
42
#include "storage/segment/bitshuffle_page.h"
43
#include "storage/segment/bitshuffle_page_pre_decoder.h"
44
#include "storage/segment/frame_of_reference_page.h"
45
#include "storage/segment/options.h"
46
#include "storage/segment/plain_page.h"
47
#include "storage/segment/rle_page.h"
48
#include "storage/tablet/tablet_schema.h"
49
#include "storage/types.h"
50
51
namespace doris {
52
namespace segment_v2 {
53
54
template <FieldType type, typename CppType>
55
struct TypeEncodingTraits<type, PLAIN_ENCODING, CppType> {
56
1.56k
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
57
1.56k
        return PlainPageBuilder<type>::create(builder, opts);
58
1.56k
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE1ELNS0_14EncodingTypePBE2EavE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
56
17
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
57
17
        return PlainPageBuilder<type>::create(builder, opts);
58
17
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE3ELNS0_14EncodingTypePBE2EsvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE5ELNS0_14EncodingTypePBE2EivE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
56
1.26k
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
57
1.26k
        return PlainPageBuilder<type>::create(builder, opts);
58
1.26k
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE7ELNS0_14EncodingTypePBE2ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
56
278
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
57
278
        return PlainPageBuilder<type>::create(builder, opts);
58
278
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE9ELNS0_14EncodingTypePBE2EnvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE10ELNS0_14EncodingTypePBE2EfvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE11ELNS0_14EncodingTypePBE2EdvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE24ELNS0_14EncodingTypePBE2EhvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE14ELNS0_14EncodingTypePBE2ENS_8uint24_tEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE28ELNS0_14EncodingTypePBE2EjvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE29ELNS0_14EncodingTypePBE2EmvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE41ELNS0_14EncodingTypePBE2ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE15ELNS0_14EncodingTypePBE2ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE40ELNS0_14EncodingTypePBE2EmvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE16ELNS0_14EncodingTypePBE2ENS_11decimal12_tEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE31ELNS0_14EncodingTypePBE2EivE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE32ELNS0_14EncodingTypePBE2ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE33ELNS0_14EncodingTypePBE2EnvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE37ELNS0_14EncodingTypePBE2EN4wide7integerILm256EiEEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE38ELNS0_14EncodingTypePBE2EjvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE39ELNS0_14EncodingTypePBE2EovE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
59
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
60
204
                                      PageDecoder** decoder) {
61
204
        *decoder = new PlainPageDecoder<type>(data, opts);
62
204
        return Status::OK();
63
204
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE1ELNS0_14EncodingTypePBE2EavE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
60
18
                                      PageDecoder** decoder) {
61
18
        *decoder = new PlainPageDecoder<type>(data, opts);
62
18
        return Status::OK();
63
18
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE3ELNS0_14EncodingTypePBE2EsvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE5ELNS0_14EncodingTypePBE2EivE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
60
176
                                      PageDecoder** decoder) {
61
176
        *decoder = new PlainPageDecoder<type>(data, opts);
62
176
        return Status::OK();
63
176
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE7ELNS0_14EncodingTypePBE2ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
60
10
                                      PageDecoder** decoder) {
61
10
        *decoder = new PlainPageDecoder<type>(data, opts);
62
10
        return Status::OK();
63
10
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE9ELNS0_14EncodingTypePBE2EnvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE10ELNS0_14EncodingTypePBE2EfvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE11ELNS0_14EncodingTypePBE2EdvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE24ELNS0_14EncodingTypePBE2EhvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE14ELNS0_14EncodingTypePBE2ENS_8uint24_tEvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE28ELNS0_14EncodingTypePBE2EjvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE29ELNS0_14EncodingTypePBE2EmvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE41ELNS0_14EncodingTypePBE2ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE15ELNS0_14EncodingTypePBE2ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE40ELNS0_14EncodingTypePBE2EmvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE16ELNS0_14EncodingTypePBE2ENS_11decimal12_tEvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE31ELNS0_14EncodingTypePBE2EivE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE32ELNS0_14EncodingTypePBE2ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE33ELNS0_14EncodingTypePBE2EnvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE37ELNS0_14EncodingTypePBE2EN4wide7integerILm256EiEEvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE38ELNS0_14EncodingTypePBE2EjvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE39ELNS0_14EncodingTypePBE2EovE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
64
};
65
66
template <FieldType type>
67
struct TypeEncodingTraits<type, PLAIN_ENCODING, Slice> {
68
15.7k
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
69
15.7k
        return BinaryPlainPageBuilder<type>::create(builder, opts);
70
15.7k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
68
4.99k
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
69
4.99k
        return BinaryPlainPageBuilder<type>::create(builder, opts);
70
4.99k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE23ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE25ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
68
10.7k
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
69
10.7k
        return BinaryPlainPageBuilder<type>::create(builder, opts);
70
10.7k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE27ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE36ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
71
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
72
2.96k
                                      PageDecoder** decoder) {
73
2.96k
        *decoder = new BinaryPlainPageDecoder<type>(data, opts);
74
2.96k
        return Status::OK();
75
2.96k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
72
44
                                      PageDecoder** decoder) {
73
44
        *decoder = new BinaryPlainPageDecoder<type>(data, opts);
74
44
        return Status::OK();
75
44
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
72
2.70k
                                      PageDecoder** decoder) {
73
2.70k
        *decoder = new BinaryPlainPageDecoder<type>(data, opts);
74
2.70k
        return Status::OK();
75
2.70k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
72
127
                                      PageDecoder** decoder) {
73
127
        *decoder = new BinaryPlainPageDecoder<type>(data, opts);
74
127
        return Status::OK();
75
127
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE23ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE25ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
72
87
                                      PageDecoder** decoder) {
73
87
        *decoder = new BinaryPlainPageDecoder<type>(data, opts);
74
87
        return Status::OK();
75
87
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE27ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE36ELNS0_14EncodingTypePBE2ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
76
};
77
78
template <FieldType type, typename CppType>
79
struct TypeEncodingTraits<type, PLAIN_ENCODING_V2, CppType> {
80
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
81
        return PlainPageBuilder<type>::create(builder, opts);
82
    }
83
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
84
                                      PageDecoder** decoder) {
85
        *decoder = new PlainPageDecoder<type>(data, opts);
86
        return Status::OK();
87
    }
88
};
89
90
template <FieldType type>
91
struct TypeEncodingTraits<type, PLAIN_ENCODING_V2, Slice> {
92
8
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
93
8
        return BinaryPlainPageV2Builder<type>::create(builder, opts);
94
8
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
92
8
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
93
8
        return BinaryPlainPageV2Builder<type>::create(builder, opts);
94
8
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE23ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE25ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE27ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE36ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
95
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
96
0
                                      PageDecoder** decoder) {
97
0
        *decoder = new BinaryPlainPageV2Decoder<type>(data, opts);
98
0
        return Status::OK();
99
0
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE23ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE25ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE27ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE36ELNS0_14EncodingTypePBE8ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
100
};
101
102
// PLAIN_ENCODING_V3 is a binary plain page, only registered for Slice (binary) types, so it
103
// has no non-Slice specialization (unlike PLAIN_ENCODING, which also serves numeric types).
104
template <FieldType type>
105
struct TypeEncodingTraits<type, PLAIN_ENCODING_V3, Slice> {
106
1.00k
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
107
1.00k
        return BinaryPlainPageV3Builder<type>::create(builder, opts);
108
1.00k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
106
999
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
107
999
        return BinaryPlainPageV3Builder<type>::create(builder, opts);
108
999
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
106
1
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
107
1
        return BinaryPlainPageV3Builder<type>::create(builder, opts);
108
1
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE23ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE25ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE27ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE36ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
109
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
110
242
                                      PageDecoder** decoder) {
111
242
        *decoder = new BinaryPlainPageV3Decoder<type>(data, opts);
112
242
        return Status::OK();
113
242
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
110
188
                                      PageDecoder** decoder) {
111
188
        *decoder = new BinaryPlainPageV3Decoder<type>(data, opts);
112
188
        return Status::OK();
113
188
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
110
54
                                      PageDecoder** decoder) {
111
54
        *decoder = new BinaryPlainPageV3Decoder<type>(data, opts);
112
54
        return Status::OK();
113
54
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE23ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE25ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE27ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE36ELNS0_14EncodingTypePBE9ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
114
};
115
116
template <FieldType type, typename CppType>
117
struct TypeEncodingTraits<type, BIT_SHUFFLE, CppType,
118
                          typename std::enable_if<!std::is_same<CppType, Slice>::value>::type> {
119
7.33k
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
7.33k
        return BitshufflePageBuilder<type>::create(builder, opts);
121
7.33k
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE1ELNS0_14EncodingTypePBE6EavE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
618
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
618
        return BitshufflePageBuilder<type>::create(builder, opts);
121
618
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE3ELNS0_14EncodingTypePBE6EsvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
13
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
13
        return BitshufflePageBuilder<type>::create(builder, opts);
121
13
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE5ELNS0_14EncodingTypePBE6EivE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
5.81k
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
5.81k
        return BitshufflePageBuilder<type>::create(builder, opts);
121
5.81k
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE7ELNS0_14EncodingTypePBE6ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
381
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
381
        return BitshufflePageBuilder<type>::create(builder, opts);
121
381
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE9ELNS0_14EncodingTypePBE6EnvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
2
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
2
        return BitshufflePageBuilder<type>::create(builder, opts);
121
2
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE8ELNS0_14EncodingTypePBE6EmvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
473
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
473
        return BitshufflePageBuilder<type>::create(builder, opts);
121
473
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE6ELNS0_14EncodingTypePBE6EjvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE10ELNS0_14EncodingTypePBE6EfvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
2
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
2
        return BitshufflePageBuilder<type>::create(builder, opts);
121
2
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE11ELNS0_14EncodingTypePBE6EdvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
1
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
1
        return BitshufflePageBuilder<type>::create(builder, opts);
121
1
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE24ELNS0_14EncodingTypePBE6EhvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE14ELNS0_14EncodingTypePBE6ENS_8uint24_tEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
4
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
4
        return BitshufflePageBuilder<type>::create(builder, opts);
121
4
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE28ELNS0_14EncodingTypePBE6EjvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
8
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
8
        return BitshufflePageBuilder<type>::create(builder, opts);
121
8
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE29ELNS0_14EncodingTypePBE6EmvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
1
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
1
        return BitshufflePageBuilder<type>::create(builder, opts);
121
1
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE41ELNS0_14EncodingTypePBE6ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE15ELNS0_14EncodingTypePBE6ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
11
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
11
        return BitshufflePageBuilder<type>::create(builder, opts);
121
11
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE40ELNS0_14EncodingTypePBE6EmvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE16ELNS0_14EncodingTypePBE6ENS_11decimal12_tEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
119
2
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
120
2
        return BitshufflePageBuilder<type>::create(builder, opts);
121
2
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE31ELNS0_14EncodingTypePBE6EivE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE32ELNS0_14EncodingTypePBE6ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE33ELNS0_14EncodingTypePBE6EnvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE37ELNS0_14EncodingTypePBE6EN4wide7integerILm256EiEEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE38ELNS0_14EncodingTypePBE6EjvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE39ELNS0_14EncodingTypePBE6EovE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
122
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
123
5.89k
                                      PageDecoder** decoder) {
124
5.89k
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
5.89k
        return Status::OK();
126
5.89k
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE1ELNS0_14EncodingTypePBE6EavE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
123
335
                                      PageDecoder** decoder) {
124
335
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
335
        return Status::OK();
126
335
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE3ELNS0_14EncodingTypePBE6EsvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
123
5
                                      PageDecoder** decoder) {
124
5
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
5
        return Status::OK();
126
5
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE5ELNS0_14EncodingTypePBE6EivE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
123
5.00k
                                      PageDecoder** decoder) {
124
5.00k
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
5.00k
        return Status::OK();
126
5.00k
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE7ELNS0_14EncodingTypePBE6ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
123
229
                                      PageDecoder** decoder) {
124
229
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
229
        return Status::OK();
126
229
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE9ELNS0_14EncodingTypePBE6EnvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE8ELNS0_14EncodingTypePBE6EmvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
123
301
                                      PageDecoder** decoder) {
124
301
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
301
        return Status::OK();
126
301
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE6ELNS0_14EncodingTypePBE6EjvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE10ELNS0_14EncodingTypePBE6EfvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
123
1
                                      PageDecoder** decoder) {
124
1
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
1
        return Status::OK();
126
1
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE11ELNS0_14EncodingTypePBE6EdvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
123
1
                                      PageDecoder** decoder) {
124
1
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
1
        return Status::OK();
126
1
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE24ELNS0_14EncodingTypePBE6EhvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE14ELNS0_14EncodingTypePBE6ENS_8uint24_tEvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE28ELNS0_14EncodingTypePBE6EjvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
123
6
                                      PageDecoder** decoder) {
124
6
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
6
        return Status::OK();
126
6
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE29ELNS0_14EncodingTypePBE6EmvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
123
1
                                      PageDecoder** decoder) {
124
1
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
1
        return Status::OK();
126
1
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE41ELNS0_14EncodingTypePBE6ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE15ELNS0_14EncodingTypePBE6ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
123
5
                                      PageDecoder** decoder) {
124
5
        *decoder = new BitShufflePageDecoder<type>(data, opts);
125
5
        return Status::OK();
126
5
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE40ELNS0_14EncodingTypePBE6EmvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE16ELNS0_14EncodingTypePBE6ENS_11decimal12_tEvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE31ELNS0_14EncodingTypePBE6EivE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE32ELNS0_14EncodingTypePBE6ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE33ELNS0_14EncodingTypePBE6EnvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE37ELNS0_14EncodingTypePBE6EN4wide7integerILm256EiEEvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE38ELNS0_14EncodingTypePBE6EjvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE39ELNS0_14EncodingTypePBE6EovE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
127
};
128
129
template <>
130
struct TypeEncodingTraits<FieldType::OLAP_FIELD_TYPE_BOOL, RLE, uint8_t> {
131
1
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
132
1
        return RlePageBuilder<FieldType::OLAP_FIELD_TYPE_BOOL>::create(builder, opts);
133
1
    }
134
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
135
1
                                      PageDecoder** decoder) {
136
1
        *decoder = new RlePageDecoder<FieldType::OLAP_FIELD_TYPE_BOOL>(data, opts);
137
1
        return Status::OK();
138
1
    }
139
};
140
141
template <FieldType type>
142
struct TypeEncodingTraits<type, DICT_ENCODING, Slice> {
143
4.28k
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
144
4.28k
        return BinaryDictPageBuilder::create(builder, opts);
145
4.28k
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE5ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
143
2
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
144
2
        return BinaryDictPageBuilder::create(builder, opts);
145
2
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE5ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
143
140
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
144
140
        return BinaryDictPageBuilder::create(builder, opts);
145
140
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE5ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
143
3.72k
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
144
3.72k
        return BinaryDictPageBuilder::create(builder, opts);
145
3.72k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE5ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE5ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
143
417
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
144
417
        return BinaryDictPageBuilder::create(builder, opts);
145
417
    }
146
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
147
4.70k
                                      PageDecoder** decoder) {
148
4.70k
        *decoder = new BinaryDictPageDecoder(data, opts);
149
4.70k
        return Status::OK();
150
4.70k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE5ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE5ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
147
1
                                      PageDecoder** decoder) {
148
1
        *decoder = new BinaryDictPageDecoder(data, opts);
149
1
        return Status::OK();
150
1
    }
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE5ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
147
4.52k
                                      PageDecoder** decoder) {
148
4.52k
        *decoder = new BinaryDictPageDecoder(data, opts);
149
4.52k
        return Status::OK();
150
4.52k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE5ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE5ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
147
181
                                      PageDecoder** decoder) {
148
181
        *decoder = new BinaryDictPageDecoder(data, opts);
149
181
        return Status::OK();
150
181
    }
151
};
152
153
template <>
154
struct TypeEncodingTraits<FieldType::OLAP_FIELD_TYPE_DATE, FOR_ENCODING,
155
                          typename CppTypeTraits<FieldType::OLAP_FIELD_TYPE_DATE>::CppType> {
156
0
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
157
0
        return FrameOfReferencePageBuilder<FieldType::OLAP_FIELD_TYPE_DATE>::create(builder, opts);
158
0
    }
159
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
160
0
                                      PageDecoder** decoder) {
161
0
        *decoder = new FrameOfReferencePageDecoder<FieldType::OLAP_FIELD_TYPE_DATE>(data, opts);
162
0
        return Status::OK();
163
0
    }
164
};
165
166
template <>
167
struct TypeEncodingTraits<FieldType::OLAP_FIELD_TYPE_DATEV2, FOR_ENCODING,
168
                          typename CppTypeTraits<FieldType::OLAP_FIELD_TYPE_DATEV2>::CppType> {
169
0
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
170
0
        return FrameOfReferencePageBuilder<FieldType::OLAP_FIELD_TYPE_DATEV2>::create(builder,
171
0
                                                                                      opts);
172
0
    }
173
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
174
0
                                      PageDecoder** decoder) {
175
0
        *decoder = new FrameOfReferencePageDecoder<FieldType::OLAP_FIELD_TYPE_DATEV2>(data, opts);
176
0
        return Status::OK();
177
0
    }
178
};
179
180
template <>
181
struct TypeEncodingTraits<FieldType::OLAP_FIELD_TYPE_DATETIMEV2, FOR_ENCODING,
182
                          typename CppTypeTraits<FieldType::OLAP_FIELD_TYPE_DATETIMEV2>::CppType> {
183
0
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
184
0
        return FrameOfReferencePageBuilder<FieldType::OLAP_FIELD_TYPE_DATETIMEV2>::create(builder,
185
0
                                                                                          opts);
186
0
    }
187
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
188
0
                                      PageDecoder** decoder) {
189
0
        *decoder =
190
0
                new FrameOfReferencePageDecoder<FieldType::OLAP_FIELD_TYPE_DATETIMEV2>(data, opts);
191
0
        return Status::OK();
192
0
    }
193
};
194
195
template <>
196
struct TypeEncodingTraits<FieldType::OLAP_FIELD_TYPE_TIMESTAMPTZ, FOR_ENCODING,
197
                          typename CppTypeTraits<FieldType::OLAP_FIELD_TYPE_TIMESTAMPTZ>::CppType> {
198
0
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
199
0
        return FrameOfReferencePageBuilder<FieldType::OLAP_FIELD_TYPE_TIMESTAMPTZ>::create(builder,
200
0
                                                                                           opts);
201
0
    }
202
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
203
0
                                      PageDecoder** decoder) {
204
0
        *decoder =
205
0
                new FrameOfReferencePageDecoder<FieldType::OLAP_FIELD_TYPE_TIMESTAMPTZ>(data, opts);
206
0
        return Status::OK();
207
0
    }
208
};
209
210
template <FieldType type, typename CppType>
211
struct TypeEncodingTraits<type, FOR_ENCODING, CppType,
212
                          typename std::enable_if<IsIntegral<CppType>::value>::type> {
213
0
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
214
0
        return FrameOfReferencePageBuilder<type>::create(builder, opts);
215
0
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE1ELNS0_14EncodingTypePBE7EavE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE3ELNS0_14EncodingTypePBE7EsvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE5ELNS0_14EncodingTypePBE7EivE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE7ELNS0_14EncodingTypePBE7ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE9ELNS0_14EncodingTypePBE7EnvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE41ELNS0_14EncodingTypePBE7ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE15ELNS0_14EncodingTypePBE7ElvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
216
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
217
0
                                      PageDecoder** decoder) {
218
0
        *decoder = new FrameOfReferencePageDecoder<type>(data, opts);
219
0
        return Status::OK();
220
0
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE1ELNS0_14EncodingTypePBE7EavE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE3ELNS0_14EncodingTypePBE7EsvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE5ELNS0_14EncodingTypePBE7EivE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE7ELNS0_14EncodingTypePBE7ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE9ELNS0_14EncodingTypePBE7EnvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE41ELNS0_14EncodingTypePBE7ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE15ELNS0_14EncodingTypePBE7ElvE19create_page_decoderERKNS_5SliceERKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
221
};
222
223
template <FieldType type>
224
struct TypeEncodingTraits<type, PREFIX_ENCODING, Slice> {
225
302
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
226
302
        return BinaryPrefixPageBuilder::create(builder, opts);
227
302
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE3ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE3ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Line
Count
Source
225
302
    static Status create_page_builder(const PageBuilderOptions& opts, PageBuilder** builder) {
226
302
        return BinaryPrefixPageBuilder::create(builder, opts);
227
302
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE3ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE3ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE3ENS_5SliceEvE19create_page_builderERKNS0_18PageBuilderOptionsEPPNS0_11PageBuilderE
228
    static Status create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
229
1.41k
                                      PageDecoder** decoder) {
230
1.41k
        *decoder = new BinaryPrefixPageDecoder(data, opts);
231
1.41k
        return Status::OK();
232
1.41k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE3ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
_ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE3ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Line
Count
Source
229
1.41k
                                      PageDecoder** decoder) {
230
1.41k
        *decoder = new BinaryPrefixPageDecoder(data, opts);
231
1.41k
        return Status::OK();
232
1.41k
    }
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE3ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE3ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
Unexecuted instantiation: _ZN5doris10segment_v218TypeEncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE3ENS_5SliceEvE19create_page_decoderERKS4_RKNS0_18PageDecoderOptionsEPPNS0_11PageDecoderE
233
};
234
235
14
EncodingInfoResolver::EncodingInfoResolver() {
236
    // ===== Phase 1: register every supported (type, encoding) combination exactly once =====
237
    // _register_supported_encoding CHECKs against duplicates; the Phase 2 calls below do not insert into _encoding_map,
238
    // so every (type, encoding) used as a default must appear here first.
239
240
    // signed integers
241
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_TINYINT, BIT_SHUFFLE>();
242
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_TINYINT, PLAIN_ENCODING>();
243
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_TINYINT, FOR_ENCODING>();
244
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_SMALLINT, BIT_SHUFFLE>();
245
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_SMALLINT, PLAIN_ENCODING>();
246
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_SMALLINT, FOR_ENCODING>();
247
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_INT, BIT_SHUFFLE>();
248
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_INT, PLAIN_ENCODING>();
249
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_INT, FOR_ENCODING>();
250
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_BIGINT, BIT_SHUFFLE>();
251
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_BIGINT, PLAIN_ENCODING>();
252
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_BIGINT, FOR_ENCODING>();
253
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_LARGEINT, BIT_SHUFFLE>();
254
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_LARGEINT, PLAIN_ENCODING>();
255
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_LARGEINT, FOR_ENCODING>();
256
257
    // unsigned integers
258
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_UNSIGNED_BIGINT, BIT_SHUFFLE>();
259
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_UNSIGNED_INT, BIT_SHUFFLE>();
260
261
    // FLOAT / DOUBLE
262
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_FLOAT, BIT_SHUFFLE>();
263
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_FLOAT, PLAIN_ENCODING>();
264
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DOUBLE, BIT_SHUFFLE>();
265
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DOUBLE, PLAIN_ENCODING>();
266
267
    // binary types (CHAR/VARCHAR/STRING/JSONB/VARIANT)
268
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_CHAR, DICT_ENCODING>();
269
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_CHAR, PLAIN_ENCODING>();
270
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_CHAR, PLAIN_ENCODING_V2>();
271
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_CHAR, PLAIN_ENCODING_V3>();
272
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_CHAR, PREFIX_ENCODING>();
273
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_VARCHAR, DICT_ENCODING>();
274
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_VARCHAR, PLAIN_ENCODING>();
275
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_VARCHAR, PLAIN_ENCODING_V2>();
276
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_VARCHAR, PLAIN_ENCODING_V3>();
277
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_VARCHAR, PREFIX_ENCODING>();
278
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_STRING, DICT_ENCODING>();
279
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_STRING, PLAIN_ENCODING>();
280
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_STRING, PLAIN_ENCODING_V2>();
281
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_STRING, PLAIN_ENCODING_V3>();
282
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_STRING, PREFIX_ENCODING>();
283
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_JSONB, DICT_ENCODING>();
284
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_JSONB, PLAIN_ENCODING>();
285
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_JSONB, PLAIN_ENCODING_V2>();
286
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_JSONB, PLAIN_ENCODING_V3>();
287
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_JSONB, PREFIX_ENCODING>();
288
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_VARIANT, DICT_ENCODING>();
289
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_VARIANT, PLAIN_ENCODING>();
290
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_VARIANT, PLAIN_ENCODING_V2>();
291
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_VARIANT, PLAIN_ENCODING_V3>();
292
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_VARIANT, PREFIX_ENCODING>();
293
294
    // BOOL
295
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_BOOL, RLE>();
296
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_BOOL, BIT_SHUFFLE>();
297
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_BOOL, PLAIN_ENCODING>();
298
299
    // date / datetime
300
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATE, BIT_SHUFFLE>();
301
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATE, PLAIN_ENCODING>();
302
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATE, FOR_ENCODING>();
303
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATEV2, BIT_SHUFFLE>();
304
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATEV2, PLAIN_ENCODING>();
305
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATEV2, FOR_ENCODING>();
306
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATETIMEV2, BIT_SHUFFLE>();
307
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATETIMEV2, PLAIN_ENCODING>();
308
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATETIMEV2, FOR_ENCODING>();
309
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATETIMEV2_NANO, BIT_SHUFFLE>();
310
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATETIMEV2_NANO, PLAIN_ENCODING>();
311
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATETIMEV2_NANO, FOR_ENCODING>();
312
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATETIME, BIT_SHUFFLE>();
313
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATETIME, PLAIN_ENCODING>();
314
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DATETIME, FOR_ENCODING>();
315
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_TIMESTAMPTZ, BIT_SHUFFLE>();
316
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_TIMESTAMPTZ, PLAIN_ENCODING>();
317
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_TIMESTAMPTZ, FOR_ENCODING>();
318
319
    // decimal
320
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DECIMAL, BIT_SHUFFLE>();
321
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DECIMAL, PLAIN_ENCODING>();
322
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DECIMAL32, BIT_SHUFFLE>();
323
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DECIMAL32, PLAIN_ENCODING>();
324
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DECIMAL64, BIT_SHUFFLE>();
325
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DECIMAL64, PLAIN_ENCODING>();
326
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DECIMAL128I, BIT_SHUFFLE>();
327
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DECIMAL128I, PLAIN_ENCODING>();
328
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DECIMAL256, BIT_SHUFFLE>();
329
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_DECIMAL256, PLAIN_ENCODING>();
330
331
    // ip
332
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_IPV4, BIT_SHUFFLE>();
333
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_IPV4, PLAIN_ENCODING>();
334
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_IPV6, BIT_SHUFFLE>();
335
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_IPV6, PLAIN_ENCODING>();
336
337
    // aggregate / binary-flavored types
338
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_HLL, PLAIN_ENCODING>();
339
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_HLL, PLAIN_ENCODING_V2>();
340
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_HLL, PLAIN_ENCODING_V3>();
341
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_BITMAP, PLAIN_ENCODING>();
342
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_BITMAP, PLAIN_ENCODING_V2>();
343
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_BITMAP, PLAIN_ENCODING_V3>();
344
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_QUANTILE_STATE, PLAIN_ENCODING>();
345
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_QUANTILE_STATE, PLAIN_ENCODING_V2>();
346
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_QUANTILE_STATE, PLAIN_ENCODING_V3>();
347
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_AGG_STATE, PLAIN_ENCODING>();
348
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_AGG_STATE, PLAIN_ENCODING_V2>();
349
14
    _register_supported_encoding<FieldType::OLAP_FIELD_TYPE_AGG_STATE, PLAIN_ENCODING_V3>();
350
351
    // ===== Phase 2a: V2 defaults (write path, V1/V2 segments) =====
352
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_TINYINT, BIT_SHUFFLE>();
353
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_SMALLINT, BIT_SHUFFLE>();
354
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_INT, BIT_SHUFFLE>();
355
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_BIGINT, BIT_SHUFFLE>();
356
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_LARGEINT, BIT_SHUFFLE>();
357
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_UNSIGNED_BIGINT, BIT_SHUFFLE>();
358
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_UNSIGNED_INT, BIT_SHUFFLE>();
359
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_FLOAT, BIT_SHUFFLE>();
360
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DOUBLE, BIT_SHUFFLE>();
361
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_CHAR, DICT_ENCODING>();
362
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_VARCHAR, DICT_ENCODING>();
363
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_STRING, DICT_ENCODING>();
364
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_JSONB, DICT_ENCODING>();
365
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_VARIANT, DICT_ENCODING>();
366
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_BOOL, RLE>();
367
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DATE, BIT_SHUFFLE>();
368
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DATEV2, BIT_SHUFFLE>();
369
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DATETIMEV2, BIT_SHUFFLE>();
370
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DATETIMEV2_NANO, BIT_SHUFFLE>();
371
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DATETIME, BIT_SHUFFLE>();
372
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_TIMESTAMPTZ, BIT_SHUFFLE>();
373
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DECIMAL, BIT_SHUFFLE>();
374
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DECIMAL32, BIT_SHUFFLE>();
375
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DECIMAL64, BIT_SHUFFLE>();
376
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DECIMAL128I, BIT_SHUFFLE>();
377
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_DECIMAL256, BIT_SHUFFLE>();
378
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_IPV4, BIT_SHUFFLE>();
379
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_IPV6, BIT_SHUFFLE>();
380
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_HLL, PLAIN_ENCODING>();
381
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_BITMAP, PLAIN_ENCODING>();
382
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_QUANTILE_STATE, PLAIN_ENCODING>();
383
14
    _set_v2_default<FieldType::OLAP_FIELD_TYPE_AGG_STATE, PLAIN_ENCODING>();
384
385
    // ===== Phase 2b: V3 defaults (write path, V3 segments) =====
386
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_TINYINT, PLAIN_ENCODING>();
387
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_SMALLINT, PLAIN_ENCODING>();
388
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_INT, PLAIN_ENCODING>();
389
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_BIGINT, PLAIN_ENCODING>();
390
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_LARGEINT, PLAIN_ENCODING>();
391
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_UNSIGNED_BIGINT, BIT_SHUFFLE>();
392
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_UNSIGNED_INT, BIT_SHUFFLE>();
393
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_FLOAT, BIT_SHUFFLE>();
394
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DOUBLE, BIT_SHUFFLE>();
395
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_CHAR, DICT_ENCODING>();
396
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_VARCHAR, DICT_ENCODING>();
397
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_STRING, DICT_ENCODING>();
398
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_JSONB, DICT_ENCODING>();
399
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_VARIANT, DICT_ENCODING>();
400
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_BOOL, RLE>();
401
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DATE, BIT_SHUFFLE>();
402
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DATEV2, BIT_SHUFFLE>();
403
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DATETIMEV2, BIT_SHUFFLE>();
404
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DATETIMEV2_NANO, BIT_SHUFFLE>();
405
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DATETIME, BIT_SHUFFLE>();
406
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_TIMESTAMPTZ, BIT_SHUFFLE>();
407
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DECIMAL, BIT_SHUFFLE>();
408
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DECIMAL32, BIT_SHUFFLE>();
409
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DECIMAL64, BIT_SHUFFLE>();
410
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DECIMAL128I, BIT_SHUFFLE>();
411
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_DECIMAL256, BIT_SHUFFLE>();
412
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_IPV4, BIT_SHUFFLE>();
413
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_IPV6, BIT_SHUFFLE>();
414
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_HLL, PLAIN_ENCODING_V3>();
415
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_BITMAP, PLAIN_ENCODING_V3>();
416
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_QUANTILE_STATE, PLAIN_ENCODING_V3>();
417
14
    _set_v3_default<FieldType::OLAP_FIELD_TYPE_AGG_STATE, PLAIN_ENCODING_V3>();
418
419
    // ===== Phase 2c: IndexedColumn (value-seek) defaults =====
420
    // Only the PrimaryKeyIndexBuilder consults this map, and it hardcodes VARCHAR.
421
    // Other types were registered historically (since #2308, 2019) for a generic
422
    // "any IndexedColumn value-seek caller" use case that never materialized; they
423
    // were removed to keep this map honest about what production actually needs.
424
14
    _set_index_column_encoding<FieldType::OLAP_FIELD_TYPE_VARCHAR, PREFIX_ENCODING>();
425
14
}
426
427
13
EncodingInfoResolver::~EncodingInfoResolver() {
428
1.20k
    for (auto& it : _encoding_map) {
429
1.20k
        delete it.second;
430
1.20k
    }
431
13
    _encoding_map.clear();
432
13
}
433
434
10.7k
EncodingTypePB EncodingInfoResolver::get_v2_default_encoding(FieldType type) const {
435
10.7k
    return _lookup(_v2_default_map, type);
436
10.7k
}
437
438
3.21k
EncodingTypePB EncodingInfoResolver::get_v3_default_encoding(FieldType type) const {
439
3.21k
    return _lookup(_v3_default_map, type);
440
3.21k
}
441
442
115
EncodingTypePB EncodingInfoResolver::get_index_column_encoding(FieldType type) const {
443
115
    return _lookup(_index_column_encoding_map, type);
444
115
}
445
446
Status EncodingInfoResolver::get(FieldType data_type, EncodingTypePB encoding_type,
447
48.2k
                                 const EncodingInfo** out) {
448
48.2k
    auto key = std::make_pair(data_type, encoding_type);
449
48.2k
    auto it = _encoding_map.find(key);
450
48.2k
    if (it == std::end(_encoding_map)) {
451
16
        return Status::InternalError("fail to find valid type encoding, type:{}, encoding:{}",
452
16
                                     data_type, encoding_type);
453
16
    }
454
48.1k
    *out = it->second;
455
48.1k
    return Status::OK();
456
48.2k
}
457
458
template <typename TraitsClass>
459
EncodingInfo::EncodingInfo(TraitsClass traits)
460
1.30k
        : _create_builder_func(TraitsClass::create_page_builder),
461
1.30k
          _create_decoder_func(TraitsClass::create_page_decoder),
462
1.30k
          _type(TraitsClass::type),
463
1.30k
          _encoding(TraitsClass::encoding) {
464
1.30k
    if (_encoding == BIT_SHUFFLE) {
465
322
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
980
    } else if (_encoding == DICT_ENCODING) {
467
70
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
14
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
56
        } else {
470
56
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
56
        }
472
910
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
420
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
14
        }
478
490
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
126
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
112
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
112
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
112
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
364
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
126
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
112
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
112
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
112
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
126
    }
514
1.30k
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE1ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE1ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE1ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE3ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE3ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE3ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE5ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE5ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE5ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE7ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE7ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE7ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE9ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE9ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE9ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE8ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE6ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE10ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE10ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE11ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE11ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE5EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
14
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
14
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
        } else {
470
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
0
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
        } else {
470
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
14
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
14
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE8EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
        } else {
470
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
0
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
14
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE9EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
        } else {
470
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
0
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
14
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
14
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE13ELNS0_14EncodingTypePBE3EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
        } else {
470
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
0
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
0
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE5EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
14
        } else {
470
14
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
14
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE8EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE9EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
14
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE17ELNS0_14EncodingTypePBE3EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE5EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
14
        } else {
470
14
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
14
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE8EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE9EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
14
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE26ELNS0_14EncodingTypePBE3EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE5EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
14
        } else {
470
14
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
14
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE8EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE9EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
14
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE34ELNS0_14EncodingTypePBE3EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE5EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
14
        } else {
470
14
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
14
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE8EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE9EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
14
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE35ELNS0_14EncodingTypePBE3EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE24ELNS0_14EncodingTypePBE4EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE24ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE24ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE14ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE14ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE14ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE28ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE28ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE28ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE29ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE29ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE29ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE41ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE41ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE41ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE15ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE15ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE15ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE40ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE40ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE40ELNS0_14EncodingTypePBE7EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE16ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE16ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE31ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE31ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE32ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE32ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE33ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE33ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE37ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE37ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE38ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE38ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE39ELNS0_14EncodingTypePBE6EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
14
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
0
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
0
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE39ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
0
        } else {
491
0
            throw Exception(Status::FatalError(
492
0
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
0
                    "non-Slice type {}",
494
0
                    int(TraitsClass::type)));
495
0
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
0
        } else {
508
0
            throw Exception(Status::FatalError(
509
0
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
0
                    "non-Slice type {}",
511
0
                    int(TraitsClass::type)));
512
0
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE23ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE23ELNS0_14EncodingTypePBE8EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE23ELNS0_14EncodingTypePBE9EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
14
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE25ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE25ELNS0_14EncodingTypePBE8EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE25ELNS0_14EncodingTypePBE9EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
14
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE27ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE27ELNS0_14EncodingTypePBE8EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE27ELNS0_14EncodingTypePBE9EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
14
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE36ELNS0_14EncodingTypePBE2EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
0
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE36ELNS0_14EncodingTypePBE8EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
0
    }
514
14
}
_ZN5doris10segment_v212EncodingInfoC2INS0_14EncodingTraitsILNS_9FieldTypeE36ELNS0_14EncodingTypePBE9EEEEET_
Line
Count
Source
460
14
        : _create_builder_func(TraitsClass::create_page_builder),
461
14
          _create_decoder_func(TraitsClass::create_page_decoder),
462
14
          _type(TraitsClass::type),
463
14
          _encoding(TraitsClass::encoding) {
464
14
    if (_encoding == BIT_SHUFFLE) {
465
0
        _data_page_pre_decoder = std::make_unique<BitShufflePagePreDecoder>();
466
14
    } else if (_encoding == DICT_ENCODING) {
467
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
468
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<true>>();
469
0
        } else {
470
0
            _data_page_pre_decoder = std::make_unique<BinaryDictPagePreDecoder<false>>();
471
0
        }
472
14
    } else if (_encoding == PLAIN_ENCODING) {
473
        // CHAR plain pages may contain trailing '\0' padding written by older
474
        // BEs; strip it once at page load so the cached page is unpadded.
475
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
476
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageCharStripPreDecoder>();
477
        }
478
14
    } else if (_encoding == PLAIN_ENCODING_V2) {
479
        // Only binary types (Slice) need the predecoder for PLAIN_ENCODING_V2 — it converts
480
        // varint-encoded lengths to an offset-array format that downstream Slice decoders expect.
481
        // CHAR pages additionally strip trailing '\0' padding written by the convertor; other
482
        // Slice types use the non-CHAR specialization. All current (type, PLAIN_ENCODING_V2)
483
        // registrations are Slice (CHAR/VARCHAR/STRING/JSONB/VARIANT/HLL/BITMAP/QUANTILE_STATE/
484
        // AGG_STATE per storage/types.h). The else throws at construction time to fail loudly
485
        // if a future non-Slice registration is added.
486
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
487
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<true>>();
488
0
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
489
0
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV2PreDecoder<false>>();
490
        } else {
491
            throw Exception(Status::FatalError(
492
                    "PLAIN_ENCODING_V2 is only supported for Slice (binary) types, but got "
493
                    "non-Slice type {}",
494
                    int(TraitsClass::type)));
495
        }
496
14
    } else if (_encoding == PLAIN_ENCODING_V3) {
497
        // V3 binary plain pages store contiguous data followed by a contiguous varuint length
498
        // block; the predecoder rewrites that into the V1 offset-array layout downstream Slice
499
        // decoders expect. CHAR uses the IS_CHAR=true variant so the trailing '\0' padding of
500
        // CHAR dictionary words (written with the VARCHAR builder) is stripped on read — mirroring
501
        // PLAIN_ENCODING_V2. strnlen on a write-stripped CHAR page is a no-op, so the variant is
502
        // also correct for direct CHAR plain V3 pages.
503
        if constexpr (TraitsClass::type == FieldType::OLAP_FIELD_TYPE_CHAR) {
504
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<true>>();
505
14
        } else if constexpr (std::is_same_v<typename TraitsClass::CppType, Slice>) {
506
14
            _data_page_pre_decoder = std::make_unique<BinaryPlainPageV3PreDecoder<false>>();
507
        } else {
508
            throw Exception(Status::FatalError(
509
                    "PLAIN_ENCODING_V3 is only supported for Slice (binary) types, but got "
510
                    "non-Slice type {}",
511
                    int(TraitsClass::type)));
512
        }
513
14
    }
514
14
}
515
516
#ifdef BE_TEST
517
static EncodingInfoResolver s_encoding_info_resolver;
518
#endif
519
520
48.2k
Status EncodingInfo::get(FieldType type, EncodingTypePB encoding_type, const EncodingInfo** out) {
521
48.2k
#ifdef BE_TEST
522
48.2k
    return s_encoding_info_resolver.get(type, encoding_type, out);
523
#else
524
    auto* resolver = ExecEnv::GetInstance()->get_encoding_info_resolver();
525
    if (resolver == nullptr) {
526
        return Status::InternalError("EncodingInfoResolver not initialized");
527
    }
528
    return resolver->get(type, encoding_type, out);
529
#endif
530
48.2k
}
531
532
10.7k
EncodingTypePB EncodingInfo::get_v2_default_encoding(FieldType type) {
533
10.7k
#ifdef BE_TEST
534
10.7k
    return s_encoding_info_resolver.get_v2_default_encoding(type);
535
#else
536
    auto* resolver = ExecEnv::GetInstance()->get_encoding_info_resolver();
537
    if (resolver == nullptr) {
538
        return UNKNOWN_ENCODING;
539
    }
540
    return resolver->get_v2_default_encoding(type);
541
#endif
542
10.7k
}
543
544
3.21k
EncodingTypePB EncodingInfo::get_v3_default_encoding(FieldType type) {
545
3.21k
#ifdef BE_TEST
546
3.21k
    return s_encoding_info_resolver.get_v3_default_encoding(type);
547
#else
548
    auto* resolver = ExecEnv::GetInstance()->get_encoding_info_resolver();
549
    if (resolver == nullptr) {
550
        return UNKNOWN_ENCODING;
551
    }
552
    return resolver->get_v3_default_encoding(type);
553
#endif
554
3.21k
}
555
556
115
EncodingTypePB EncodingInfo::get_index_column_encoding(FieldType type) {
557
115
#ifdef BE_TEST
558
115
    return s_encoding_info_resolver.get_index_column_encoding(type);
559
#else
560
    auto* resolver = ExecEnv::GetInstance()->get_encoding_info_resolver();
561
    if (resolver == nullptr) {
562
        return UNKNOWN_ENCODING;
563
    }
564
    return resolver->get_index_column_encoding(type);
565
#endif
566
115
}
567
568
EncodingTypePB EncodingInfo::resolve_default_encoding(TabletStorageFormatPB storage_format,
569
13.7k
                                                      const TabletColumn& column) {
570
13.7k
    const bool is_v3 = (storage_format == TabletStorageFormatPB::TABLET_STORAGE_FORMAT_V3);
571
572
    // Row store data is already serialized as a single blob. Keep it on plain pages to
573
    // avoid introducing dictionary pages for the hidden row store column; V3 segments use
574
    // the V3 binary plain layout.
575
13.7k
    if (column.is_row_store_column()) {
576
1
        return is_v3 ? PLAIN_ENCODING_V3 : PLAIN_ENCODING;
577
1
    }
578
13.7k
    return is_v3 ? get_v3_default_encoding(column.type()) : get_v2_default_encoding(column.type());
579
13.7k
}
580
581
Status EncodingInfo::create_page_builder(const PageBuilderOptions& opts,
582
5.87k
                                         std::unique_ptr<PageBuilder>& builder) const {
583
5.87k
    PageBuilder* raw_builder = nullptr;
584
5.87k
    RETURN_IF_ERROR(_create_builder_func(opts, &raw_builder));
585
5.87k
    builder.reset(raw_builder);
586
5.87k
    return Status::OK();
587
5.87k
}
588
589
Status EncodingInfo::create_page_decoder(const Slice& data, const PageDecoderOptions& opts,
590
3.07k
                                         std::unique_ptr<PageDecoder>& decoder) const {
591
3.07k
    PageDecoder* raw_decoder = nullptr;
592
3.07k
    RETURN_IF_ERROR(_create_decoder_func(data, opts, &raw_decoder));
593
3.07k
    decoder.reset(raw_decoder);
594
3.07k
    return Status::OK();
595
3.07k
}
596
597
} // namespace segment_v2
598
} // namespace doris