Coverage Report

Created: 2026-10-20 14:42

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/core/field.h
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
// This file is copied from
18
// https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Field.h
19
// and modified by Doris
20
21
#pragma once
22
23
#include <fmt/format.h>
24
#include <glog/logging.h>
25
26
#include <algorithm>
27
#include <cassert>
28
#include <cmath>
29
#include <cstring>
30
#include <string>
31
#include <string_view>
32
#include <type_traits>
33
#include <utility>
34
#include <vector>
35
36
#include "common/compiler_util.h" // IWYU pragma: keep
37
#include "common/exception.h"
38
#include "core/data_type/primitive_type.h"
39
#include "core/string_view.h"
40
#include "core/types.h"
41
#include "core/uint128.h"
42
#include "core/value/bitmap_value.h"
43
#include "core/value/hll.h"
44
#include "core/value/quantile_state.h"
45
#include "core/value/variant/variant_field.h"
46
47
namespace doris {
48
template <PrimitiveType type>
49
struct PrimitiveTypeTraits;
50
template <typename T>
51
struct TypeName;
52
struct PackedInt128;
53
} // namespace doris
54
55
namespace doris {
56
57
class Field;
58
59
using FieldVector = std::vector<Field>;
60
61
/// Array and Struct use the same storage type -- FieldVector, but we declare
62
/// distinct types for them, so that the caller can choose whether it wants to
63
/// construct a Field of Array or a Struct type. An alternative approach would be
64
/// to construct both of these types from FieldVector, and have the caller
65
/// specify the desired Field type explicitly.
66
struct Array : public FieldVector {
67
    using FieldVector::FieldVector;
68
};
69
70
struct Struct : public FieldVector {
71
    using FieldVector::FieldVector;
72
};
73
74
struct Map : public FieldVector {
75
    using FieldVector::FieldVector;
76
};
77
78
//TODO: rethink if we really need this? it only save one pointer from std::string
79
// not POD type so could only use read/write_json_binary instead of read/write_binary
80
class JsonbField {
81
public:
82
43.9k
    JsonbField() = default;
83
175k
    ~JsonbField() = default; // unique_ptr will handle cleanup automatically
84
85
43.9k
    JsonbField(const char* ptr, size_t len) : size(len) {
86
43.9k
        data = std::make_unique<char[]>(size);
87
43.9k
        if (!data) {
88
0
            throw Exception(Status::FatalError("new data buffer failed, size: {}", size));
89
0
        }
90
43.9k
        if (size > 0) {
91
43.4k
            memcpy(data.get(), ptr, size);
92
43.4k
        }
93
43.9k
    }
94
95
17
    JsonbField(const JsonbField& x) : size(x.size) {
96
17
        data = std::make_unique<char[]>(size);
97
17
        if (!data) {
98
0
            throw Exception(Status::FatalError("new data buffer failed, size: {}", size));
99
0
        }
100
17
        if (size > 0) {
101
17
            memcpy(data.get(), x.data.get(), size);
102
17
        }
103
17
    }
104
105
87.9k
    JsonbField(JsonbField&& x) noexcept : data(std::move(x.data)), size(x.size) { x.size = 0; }
106
107
    // dispatch for all type of storage. so need this. but not really used now.
108
2
    JsonbField& operator=(const JsonbField& x) {
109
2
        if (this != &x) {
110
2
            data = std::make_unique<char[]>(x.size);
111
2
            if (!data) {
112
0
                throw Exception(Status::FatalError("new data buffer failed, size: {}", x.size));
113
0
            }
114
2
            if (x.size > 0) {
115
1
                memcpy(data.get(), x.data.get(), x.size);
116
1
            }
117
2
            size = x.size;
118
2
        }
119
2
        return *this;
120
2
    }
121
122
43.9k
    JsonbField& operator=(JsonbField&& x) noexcept {
123
43.9k
        if (this != &x) {
124
43.9k
            data = std::move(x.data);
125
43.9k
            size = x.size;
126
43.9k
            x.size = 0;
127
43.9k
        }
128
43.9k
        return *this;
129
43.9k
    }
130
131
44.0k
    const char* get_value() const { return data.get(); }
132
44.0k
    size_t get_size() const { return size; }
133
134
0
    bool operator<(const JsonbField& r) const {
135
0
        throw Exception(Status::FatalError("comparing between JsonbField is not supported"));
136
0
    }
137
0
    bool operator<=(const JsonbField& r) const {
138
0
        throw Exception(Status::FatalError("comparing between JsonbField is not supported"));
139
0
    }
140
0
    bool operator==(const JsonbField& r) const {
141
0
        throw Exception(Status::FatalError("comparing between JsonbField is not supported"));
142
0
    }
143
0
    bool operator>(const JsonbField& r) const {
144
0
        throw Exception(Status::FatalError("comparing between JsonbField is not supported"));
145
0
    }
146
0
    bool operator>=(const JsonbField& r) const {
147
0
        throw Exception(Status::FatalError("comparing between JsonbField is not supported"));
148
0
    }
149
0
    bool operator!=(const JsonbField& r) const {
150
0
        throw Exception(Status::FatalError("comparing between JsonbField is not supported"));
151
0
    }
152
153
0
    const JsonbField& operator+=(const JsonbField& r) {
154
0
        throw Exception(Status::FatalError("Not support plus opration on JsonbField"));
155
0
    }
156
157
0
    const JsonbField& operator-=(const JsonbField& r) {
158
0
        throw Exception(Status::FatalError("Not support minus opration on JsonbField"));
159
0
    }
160
161
private:
162
    std::unique_ptr<char[]> data = nullptr;
163
    size_t size = 0;
164
};
165
166
template <typename T>
167
bool decimal_equal(T x, T y, UInt32 x_scale, UInt32 y_scale);
168
template <typename T>
169
bool decimal_less(T x, T y, UInt32 x_scale, UInt32 y_scale);
170
template <typename T>
171
bool decimal_less_or_equal(T x, T y, UInt32 x_scale, UInt32 y_scale);
172
173
/** 32 is enough. Round number is used for alignment and for better arithmetic inside std::vector.
174
  * NOTE: Actually, sizeof(std::string) is 32 when using libc++, so Field is 40 bytes.
175
  */
176
constexpr size_t DBMS_MIN_FIELD_SIZE = 32;
177
178
/** Discriminated union of several types.
179
  * Made for replacement of `boost::variant`
180
  *  is not generalized,
181
  *  but somewhat more efficient, and simpler.
182
  *
183
  * Used to represent a single value of one of several types in memory.
184
  * Warning! Prefer to use chunks of columns instead of single values. See Column.h
185
  */
186
class Field {
187
public:
188
    static const int MIN_NON_POD = 16;
189
197M
    Field() : type(PrimitiveType::TYPE_NULL) {}
190
    // set Types::Null explictly and avoid other types
191
9.77M
    Field(PrimitiveType w) : type(w) {}
192
    template <PrimitiveType T>
193
30.5M
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
30.5M
        auto f = Field();
197
30.5M
        f.template create_concrete<T>(data);
198
30.5M
        return f;
199
30.5M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE23EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
1.01M
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
1.01M
        auto f = Field();
197
1.01M
        f.template create_concrete<T>(data);
198
1.01M
        return f;
199
1.01M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE37EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
24.3k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
24.3k
        auto f = Field();
197
24.3k
        f.template create_concrete<T>(data);
198
24.3k
        return f;
199
24.3k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE41EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
66
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
66
        auto f = Field();
197
66
        f.template create_concrete<T>(data);
198
66
        return f;
199
66
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE5EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
26.5M
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
26.5M
        auto f = Field();
197
26.5M
        f.template create_concrete<T>(data);
198
26.5M
        return f;
199
26.5M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE17EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
37.5k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
37.5k
        auto f = Field();
197
37.5k
        f.template create_concrete<T>(data);
198
37.5k
        return f;
199
37.5k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE28EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
22.9k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
22.9k
        auto f = Field();
197
22.9k
        f.template create_concrete<T>(data);
198
22.9k
        return f;
199
22.9k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE29EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
28.0k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
28.0k
        auto f = Field();
197
28.0k
        f.template create_concrete<T>(data);
198
28.0k
        return f;
199
28.0k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE20EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
8.66k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
8.66k
        auto f = Field();
197
8.66k
        f.template create_concrete<T>(data);
198
8.66k
        return f;
199
8.66k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE30EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
28.1k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
28.1k
        auto f = Field();
197
28.1k
        f.template create_concrete<T>(data);
198
28.1k
        return f;
199
28.1k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE35EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
38.4k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
38.4k
        auto f = Field();
197
38.4k
        f.template create_concrete<T>(data);
198
38.4k
        return f;
199
38.4k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE19EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
409
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
409
        auto f = Field();
197
409
        f.template create_concrete<T>(data);
198
409
        return f;
199
409
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE24EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
22.3k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
22.3k
        auto f = Field();
197
22.3k
        f.template create_concrete<T>(data);
198
22.3k
        return f;
199
22.3k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE22EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
2.43k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
2.43k
        auto f = Field();
197
2.43k
        f.template create_concrete<T>(data);
198
2.43k
        return f;
199
2.43k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE2EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
31.2k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
31.2k
        auto f = Field();
197
31.2k
        f.template create_concrete<T>(data);
198
31.2k
        return f;
199
31.2k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE3EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
444k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
444k
        auto f = Field();
197
444k
        f.template create_concrete<T>(data);
198
444k
        return f;
199
444k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE4EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
54.4k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
54.4k
        auto f = Field();
197
54.4k
        f.template create_concrete<T>(data);
198
54.4k
        return f;
199
54.4k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE6EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
194k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
194k
        auto f = Field();
197
194k
        f.template create_concrete<T>(data);
198
194k
        return f;
199
194k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE7EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
39.1k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
39.1k
        auto f = Field();
197
39.1k
        f.template create_concrete<T>(data);
198
39.1k
        return f;
199
39.1k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE8EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
44.4k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
44.4k
        auto f = Field();
197
44.4k
        f.template create_concrete<T>(data);
198
44.4k
        return f;
199
44.4k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE9EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
773k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
773k
        auto f = Field();
197
773k
        f.template create_concrete<T>(data);
198
773k
        return f;
199
773k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE36EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
33.7k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
33.7k
        auto f = Field();
197
33.7k
        f.template create_concrete<T>(data);
198
33.7k
        return f;
199
33.7k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE44EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
103k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
103k
        auto f = Field();
197
103k
        f.template create_concrete<T>(data);
198
103k
        return f;
199
103k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE11EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
13.1k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
13.1k
        auto f = Field();
197
13.1k
        f.template create_concrete<T>(data);
198
13.1k
        return f;
199
13.1k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE25EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
597k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
597k
        auto f = Field();
197
597k
        f.template create_concrete<T>(data);
198
597k
        return f;
199
597k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE12EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
13.7k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
13.7k
        auto f = Field();
197
13.7k
        f.template create_concrete<T>(data);
198
13.7k
        return f;
199
13.7k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE26EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
104k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
104k
        auto f = Field();
197
104k
        f.template create_concrete<T>(data);
198
104k
        return f;
199
104k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE43EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
6.63k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
6.63k
        auto f = Field();
197
6.63k
        f.template create_concrete<T>(data);
198
6.63k
        return f;
199
6.63k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE27EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
321
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
321
        auto f = Field();
197
321
        f.template create_concrete<T>(data);
198
321
        return f;
199
321
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE42EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
18.0k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
18.0k
        auto f = Field();
197
18.0k
        f.template create_concrete<T>(data);
198
18.0k
        return f;
199
18.0k
    }
Unexecuted instantiation: _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE38EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Unexecuted instantiation: _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE39EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE15EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
1.35k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
1.35k
        auto f = Field();
197
1.35k
        f.template create_concrete<T>(data);
198
1.35k
        return f;
199
1.35k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE10EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
320k
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
320k
        auto f = Field();
197
320k
        f.template create_concrete<T>(data);
198
320k
        return f;
199
320k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE31EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
193
4
    static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) {
194
        // Publish the type only after construction succeeds, so allocation failures cannot
195
        // destroy uninitialized owned storage (including long binary values).
196
4
        auto f = Field();
197
4
        f.template create_concrete<T>(data);
198
4
        return f;
199
4
    }
200
    template <PrimitiveType T>
201
95.6M
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
95.6M
        auto f = Field();
203
95.6M
        f.template create_concrete<T>(std::move(data));
204
95.6M
        return f;
205
95.6M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE23EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
19.3M
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
19.3M
        auto f = Field();
203
19.3M
        f.template create_concrete<T>(std::move(data));
204
19.3M
        return f;
205
19.3M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE17EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
130k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
130k
        auto f = Field();
203
130k
        f.template create_concrete<T>(std::move(data));
204
130k
        return f;
205
130k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE1EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
81.2k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
81.2k
        auto f = Field();
203
81.2k
        f.template create_concrete<T>(std::move(data));
204
81.2k
        return f;
205
81.2k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE18EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
17.4k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
17.4k
        auto f = Field();
203
17.4k
        f.template create_concrete<T>(std::move(data));
204
17.4k
        return f;
205
17.4k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE25EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
230k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
230k
        auto f = Field();
203
230k
        f.template create_concrete<T>(std::move(data));
204
230k
        return f;
205
230k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE26EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
2.28M
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
2.28M
        auto f = Field();
203
2.28M
        f.template create_concrete<T>(std::move(data));
204
2.28M
        return f;
205
2.28M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE12EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
6.60k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
6.60k
        auto f = Field();
203
6.60k
        f.template create_concrete<T>(std::move(data));
204
6.60k
        return f;
205
6.60k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE28EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
49.6k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
49.6k
        auto f = Field();
203
49.6k
        f.template create_concrete<T>(std::move(data));
204
49.6k
        return f;
205
49.6k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE29EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
13.6M
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
13.6M
        auto f = Field();
203
13.6M
        f.template create_concrete<T>(std::move(data));
204
13.6M
        return f;
205
13.6M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE20EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
10.9k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
10.9k
        auto f = Field();
203
10.9k
        f.template create_concrete<T>(std::move(data));
204
10.9k
        return f;
205
10.9k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE30EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
86.1k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
86.1k
        auto f = Field();
203
86.1k
        f.template create_concrete<T>(std::move(data));
204
86.1k
        return f;
205
86.1k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE35EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
9.56k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
9.56k
        auto f = Field();
203
9.56k
        f.template create_concrete<T>(std::move(data));
204
9.56k
        return f;
205
9.56k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE36EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
5.09k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
5.09k
        auto f = Field();
203
5.09k
        f.template create_concrete<T>(std::move(data));
204
5.09k
        return f;
205
5.09k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE31EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
87.9k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
87.9k
        auto f = Field();
203
87.9k
        f.template create_concrete<T>(std::move(data));
204
87.9k
        return f;
205
87.9k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE44EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
16.4k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
16.4k
        auto f = Field();
203
16.4k
        f.template create_concrete<T>(std::move(data));
204
16.4k
        return f;
205
16.4k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE41EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
163
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
163
        auto f = Field();
203
163
        f.template create_concrete<T>(std::move(data));
204
163
        return f;
205
163
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE22EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
78
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
78
        auto f = Field();
203
78
        f.template create_concrete<T>(std::move(data));
204
78
        return f;
205
78
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE11EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
6.69k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
6.69k
        auto f = Field();
203
6.69k
        f.template create_concrete<T>(std::move(data));
204
6.69k
        return f;
205
6.69k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE19EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
15
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
15
        auto f = Field();
203
15
        f.template create_concrete<T>(std::move(data));
204
15
        return f;
205
15
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE37EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
2.92k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
2.92k
        auto f = Field();
203
2.92k
        f.template create_concrete<T>(std::move(data));
204
2.92k
        return f;
205
2.92k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE16EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
4.47k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
4.47k
        auto f = Field();
203
4.47k
        f.template create_concrete<T>(std::move(data));
204
4.47k
        return f;
205
4.47k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE32EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
10.8k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
10.8k
        auto f = Field();
203
10.8k
        f.template create_concrete<T>(std::move(data));
204
10.8k
        return f;
205
10.8k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE2EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
28.3M
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
28.3M
        auto f = Field();
203
28.3M
        f.template create_concrete<T>(std::move(data));
204
28.3M
        return f;
205
28.3M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE3EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
4.90M
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
4.90M
        auto f = Field();
203
4.90M
        f.template create_concrete<T>(std::move(data));
204
4.90M
        return f;
205
4.90M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE4EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
100k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
100k
        auto f = Field();
203
100k
        f.template create_concrete<T>(std::move(data));
204
100k
        return f;
205
100k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE5EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
1.81M
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
1.81M
        auto f = Field();
203
1.81M
        f.template create_concrete<T>(std::move(data));
204
1.81M
        return f;
205
1.81M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE6EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
23.3M
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
23.3M
        auto f = Field();
203
23.3M
        f.template create_concrete<T>(std::move(data));
204
23.3M
        return f;
205
23.3M
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE7EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
128k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
128k
        auto f = Field();
203
128k
        f.template create_concrete<T>(std::move(data));
204
128k
        return f;
205
128k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE8EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
53.9k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
53.9k
        auto f = Field();
203
53.9k
        f.template create_concrete<T>(std::move(data));
204
53.9k
        return f;
205
53.9k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE9EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
67.4k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
67.4k
        auto f = Field();
203
67.4k
        f.template create_concrete<T>(std::move(data));
204
67.4k
        return f;
205
67.4k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE27EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
7
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
7
        auto f = Field();
203
7
        f.template create_concrete<T>(std::move(data));
204
7
        return f;
205
7
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE24EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
12
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
12
        auto f = Field();
203
12
        f.template create_concrete<T>(std::move(data));
204
12
        return f;
205
12
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE42EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
31.2k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
31.2k
        auto f = Field();
203
31.2k
        f.template create_concrete<T>(std::move(data));
204
31.2k
        return f;
205
31.2k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE43EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
749
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
749
        auto f = Field();
203
749
        f.template create_concrete<T>(std::move(data));
204
749
        return f;
205
749
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE15EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
54.7k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
54.7k
        auto f = Field();
203
54.7k
        f.template create_concrete<T>(std::move(data));
204
54.7k
        return f;
205
54.7k
    }
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE10EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE
Line
Count
Source
201
779k
    static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) {
202
779k
        auto f = Field();
203
779k
        f.template create_concrete<T>(std::move(data));
204
779k
        return f;
205
779k
    }
206
207
    template <PrimitiveType PType, typename ValType = std::conditional_t<
208
                                           doris::is_string_type(PType), StringRef,
209
                                           typename PrimitiveTypeTraits<PType>::StorageFieldType>>
210
1.52M
    static Field create_field_from_olap_value(const ValType& data) {
211
1.52M
        auto f = Field(PType);
212
1.52M
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
1.52M
        if constexpr (is_string_type(PType)) {
214
490k
            cpp_value = String(data.data, data.size);
215
490k
        } else if constexpr (is_date_or_datetime(PType)) {
216
1.66k
            if constexpr (PType == TYPE_DATE) {
217
689
                cpp_value.from_olap_date(data);
218
979
            } else {
219
979
                cpp_value.from_olap_datetime(data);
220
979
            }
221
1.66k
        } else if constexpr (is_decimalv2(PType)) {
222
429
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
1.03M
        } else {
224
1.03M
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
1.03M
        }
226
1.52M
        f.template create_concrete<PType>(std::move(cpp_value));
227
1.52M
        return f;
228
1.52M
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE3EaEES0_RKT0_
Line
Count
Source
210
84.2k
    static Field create_field_from_olap_value(const ValType& data) {
211
84.2k
        auto f = Field(PType);
212
84.2k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
84.2k
        } else {
224
84.2k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
84.2k
        }
226
84.2k
        f.template create_concrete<PType>(std::move(cpp_value));
227
84.2k
        return f;
228
84.2k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE4EsEES0_RKT0_
Line
Count
Source
210
22.4k
    static Field create_field_from_olap_value(const ValType& data) {
211
22.4k
        auto f = Field(PType);
212
22.4k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
22.4k
        } else {
224
22.4k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
22.4k
        }
226
22.4k
        f.template create_concrete<PType>(std::move(cpp_value));
227
22.4k
        return f;
228
22.4k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE5EiEES0_RKT0_
Line
Count
Source
210
206k
    static Field create_field_from_olap_value(const ValType& data) {
211
206k
        auto f = Field(PType);
212
206k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
206k
        } else {
224
206k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
206k
        }
226
206k
        f.template create_concrete<PType>(std::move(cpp_value));
227
206k
        return f;
228
206k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE6ElEES0_RKT0_
Line
Count
Source
210
441k
    static Field create_field_from_olap_value(const ValType& data) {
211
441k
        auto f = Field(PType);
212
441k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
441k
        } else {
224
441k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
441k
        }
226
441k
        f.template create_concrete<PType>(std::move(cpp_value));
227
441k
        return f;
228
441k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE7EnEES0_RKT0_
Line
Count
Source
210
33.5k
    static Field create_field_from_olap_value(const ValType& data) {
211
33.5k
        auto f = Field(PType);
212
33.5k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
33.5k
        } else {
224
33.5k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
33.5k
        }
226
33.5k
        f.template create_concrete<PType>(std::move(cpp_value));
227
33.5k
        return f;
228
33.5k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE8EfEES0_RKT0_
Line
Count
Source
210
14.0k
    static Field create_field_from_olap_value(const ValType& data) {
211
14.0k
        auto f = Field(PType);
212
14.0k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
14.0k
        } else {
224
14.0k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
14.0k
        }
226
14.0k
        f.template create_concrete<PType>(std::move(cpp_value));
227
14.0k
        return f;
228
14.0k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE9EdEES0_RKT0_
Line
Count
Source
210
19.9k
    static Field create_field_from_olap_value(const ValType& data) {
211
19.9k
        auto f = Field(PType);
212
19.9k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
19.9k
        } else {
224
19.9k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
19.9k
        }
226
19.9k
        f.template create_concrete<PType>(std::move(cpp_value));
227
19.9k
        return f;
228
19.9k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE15ENS_9StringRefEEES0_RKT0_
Line
Count
Source
210
34.6k
    static Field create_field_from_olap_value(const ValType& data) {
211
34.6k
        auto f = Field(PType);
212
34.6k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
34.6k
        if constexpr (is_string_type(PType)) {
214
34.6k
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
        } else {
224
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
        }
226
34.6k
        f.template create_concrete<PType>(std::move(cpp_value));
227
34.6k
        return f;
228
34.6k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE11ENS_8uint24_tEEES0_RKT0_
Line
Count
Source
210
689
    static Field create_field_from_olap_value(const ValType& data) {
211
689
        auto f = Field(PType);
212
689
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
689
        } else if constexpr (is_date_or_datetime(PType)) {
216
689
            if constexpr (PType == TYPE_DATE) {
217
689
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
        } else {
224
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
        }
226
689
        f.template create_concrete<PType>(std::move(cpp_value));
227
689
        return f;
228
689
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE12EmEES0_RKT0_
Line
Count
Source
210
979
    static Field create_field_from_olap_value(const ValType& data) {
211
979
        auto f = Field(PType);
212
979
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
979
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
979
            } else {
219
979
                cpp_value.from_olap_datetime(data);
220
979
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
        } else {
224
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
        }
226
979
        f.template create_concrete<PType>(std::move(cpp_value));
227
979
        return f;
228
979
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE25EjEES0_RKT0_
Line
Count
Source
210
59.9k
    static Field create_field_from_olap_value(const ValType& data) {
211
59.9k
        auto f = Field(PType);
212
59.9k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
59.9k
        } else {
224
59.9k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
59.9k
        }
226
59.9k
        f.template create_concrete<PType>(std::move(cpp_value));
227
59.9k
        return f;
228
59.9k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE26EmEES0_RKT0_
Line
Count
Source
210
67.0k
    static Field create_field_from_olap_value(const ValType& data) {
211
67.0k
        auto f = Field(PType);
212
67.0k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
67.0k
        } else {
224
67.0k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
67.0k
        }
226
67.0k
        f.template create_concrete<PType>(std::move(cpp_value));
227
67.0k
        return f;
228
67.0k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE43ElEES0_RKT0_
Line
Count
Source
210
300
    static Field create_field_from_olap_value(const ValType& data) {
211
300
        auto f = Field(PType);
212
300
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
300
        } else {
224
300
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
300
        }
226
300
        f.template create_concrete<PType>(std::move(cpp_value));
227
300
        return f;
228
300
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE42EmEES0_RKT0_
Line
Count
Source
210
7.07k
    static Field create_field_from_olap_value(const ValType& data) {
211
7.07k
        auto f = Field(PType);
212
7.07k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
7.07k
        } else {
224
7.07k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
7.07k
        }
226
7.07k
        f.template create_concrete<PType>(std::move(cpp_value));
227
7.07k
        return f;
228
7.07k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE36EjEES0_RKT0_
Line
Count
Source
210
1.04k
    static Field create_field_from_olap_value(const ValType& data) {
211
1.04k
        auto f = Field(PType);
212
1.04k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
1.04k
        } else {
224
1.04k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
1.04k
        }
226
1.04k
        f.template create_concrete<PType>(std::move(cpp_value));
227
1.04k
        return f;
228
1.04k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE37EoEES0_RKT0_
Line
Count
Source
210
1.06k
    static Field create_field_from_olap_value(const ValType& data) {
211
1.06k
        auto f = Field(PType);
212
1.06k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
1.06k
        } else {
224
1.06k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
1.06k
        }
226
1.06k
        f.template create_concrete<PType>(std::move(cpp_value));
227
1.06k
        return f;
228
1.06k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE44EoEES0_RKT0_
Line
Count
Source
210
889
    static Field create_field_from_olap_value(const ValType& data) {
211
889
        auto f = Field(PType);
212
889
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
889
        } else {
224
889
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
889
        }
226
889
        f.template create_concrete<PType>(std::move(cpp_value));
227
889
        return f;
228
889
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE10ENS_9StringRefEEES0_RKT0_
Line
Count
Source
210
310k
    static Field create_field_from_olap_value(const ValType& data) {
211
310k
        auto f = Field(PType);
212
310k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
310k
        if constexpr (is_string_type(PType)) {
214
310k
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
        } else {
224
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
        }
226
310k
        f.template create_concrete<PType>(std::move(cpp_value));
227
310k
        return f;
228
310k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE23ENS_9StringRefEEES0_RKT0_
Line
Count
Source
210
145k
    static Field create_field_from_olap_value(const ValType& data) {
211
145k
        auto f = Field(PType);
212
145k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
145k
        if constexpr (is_string_type(PType)) {
214
145k
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
        } else {
224
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
        }
226
145k
        f.template create_concrete<PType>(std::move(cpp_value));
227
145k
        return f;
228
145k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE28EiEES0_RKT0_
Line
Count
Source
210
6.93k
    static Field create_field_from_olap_value(const ValType& data) {
211
6.93k
        auto f = Field(PType);
212
6.93k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
6.93k
        } else {
224
6.93k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
6.93k
        }
226
6.93k
        f.template create_concrete<PType>(std::move(cpp_value));
227
6.93k
        return f;
228
6.93k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE29ElEES0_RKT0_
Line
Count
Source
210
31.1k
    static Field create_field_from_olap_value(const ValType& data) {
211
31.1k
        auto f = Field(PType);
212
31.1k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
31.1k
        } else {
224
31.1k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
31.1k
        }
226
31.1k
        f.template create_concrete<PType>(std::move(cpp_value));
227
31.1k
        return f;
228
31.1k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE30EnEES0_RKT0_
Line
Count
Source
210
20.1k
    static Field create_field_from_olap_value(const ValType& data) {
211
20.1k
        auto f = Field(PType);
212
20.1k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
20.1k
        } else {
224
20.1k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
20.1k
        }
226
20.1k
        f.template create_concrete<PType>(std::move(cpp_value));
227
20.1k
        return f;
228
20.1k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE35EN4wide7integerILm256EiEEEES0_RKT0_
Line
Count
Source
210
1.16k
    static Field create_field_from_olap_value(const ValType& data) {
211
1.16k
        auto f = Field(PType);
212
1.16k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
1.16k
        } else {
224
1.16k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
1.16k
        }
226
1.16k
        f.template create_concrete<PType>(std::move(cpp_value));
227
1.16k
        return f;
228
1.16k
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE20ENS_11decimal12_tEEES0_RKT0_
Line
Count
Source
210
429
    static Field create_field_from_olap_value(const ValType& data) {
211
429
        auto f = Field(PType);
212
429
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
429
        } else if constexpr (is_decimalv2(PType)) {
222
429
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
        } else {
224
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
        }
226
429
        f.template create_concrete<PType>(std::move(cpp_value));
227
429
        return f;
228
429
    }
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE2EhEES0_RKT0_
Line
Count
Source
210
16.2k
    static Field create_field_from_olap_value(const ValType& data) {
211
16.2k
        auto f = Field(PType);
212
16.2k
        typename PrimitiveTypeTraits<PType>::CppType cpp_value;
213
        if constexpr (is_string_type(PType)) {
214
            cpp_value = String(data.data, data.size);
215
        } else if constexpr (is_date_or_datetime(PType)) {
216
            if constexpr (PType == TYPE_DATE) {
217
                cpp_value.from_olap_date(data);
218
            } else {
219
                cpp_value.from_olap_datetime(data);
220
            }
221
        } else if constexpr (is_decimalv2(PType)) {
222
            cpp_value = DecimalV2Value(data.integer, data.fraction);
223
16.2k
        } else {
224
16.2k
            cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data);
225
16.2k
        }
226
16.2k
        f.template create_concrete<PType>(std::move(cpp_value));
227
16.2k
        return f;
228
16.2k
    }
229
230
    /** Despite the presence of a template constructor, this constructor is still needed,
231
      *  since, in its absence, the compiler will still generate the default constructor.
232
      */
233
    Field(const Field& rhs);
234
235
    Field(Field&& rhs);
236
237
    Field& operator=(const Field& rhs);
238
239
0
    bool is_complex_field() const {
240
0
        return type == PrimitiveType::TYPE_ARRAY || type == PrimitiveType::TYPE_MAP ||
241
0
               type == PrimitiveType::TYPE_STRUCT || type == PrimitiveType::TYPE_VARIANT;
242
0
    }
243
244
65.5M
    Field& operator=(Field&& rhs) {
245
65.5M
        if (this != &rhs) {
246
65.5M
            if (type != rhs.type) {
247
63.0M
                destroy();
248
63.0M
                type = TYPE_NULL;
249
63.0M
                create(std::move(rhs));
250
63.0M
            } else {
251
2.47M
                assign(std::move(rhs));
252
2.47M
            }
253
65.5M
        }
254
65.5M
        return *this;
255
65.5M
    }
256
257
419M
    ~Field() { destroy(); }
258
259
30.1M
    PrimitiveType get_type() const { return type; }
260
    std::string get_type_name() const;
261
262
148M
    bool is_null() const { return type == PrimitiveType::TYPE_NULL; }
263
264
    // The template parameter T needs to be consistent with `which`.
265
    // If not, use NearestFieldType<> externally.
266
    // Maybe modify this in the future, reference: https://github.com/ClickHouse/ClickHouse/pull/22003
267
    template <PrimitiveType T>
268
    typename PrimitiveTypeTraits<T>::CppType& get();
269
270
    template <PrimitiveType T>
271
    const typename PrimitiveTypeTraits<T>::CppType& get() const;
272
273
7.78k
    bool is_nan() const {
274
        // Keep type dispatch with the value so callers cannot reinterpret Field storage using a
275
        // mismatched PrimitiveType.
276
7.78k
        if (type == PrimitiveType::TYPE_FLOAT) {
277
124
            return std::isnan(get<TYPE_FLOAT>());
278
124
        }
279
7.65k
        if (type == PrimitiveType::TYPE_DOUBLE) {
280
124
            return std::isnan(get<TYPE_DOUBLE>());
281
124
        }
282
7.53k
        return false;
283
7.65k
    }
284
285
7.95M
    bool operator==(const Field& rhs) const {
286
7.95M
        return operator<=>(rhs) == std::strong_ordering::equal;
287
7.95M
    }
288
289
    std::strong_ordering operator<=>(const Field& rhs) const;
290
291
    std::string_view as_string_view() const;
292
293
    // Return a human-readable representation of the stored value for debugging.
294
    // Unlike get_type_name() which returns the type, this prints the actual value.
295
    // For decimal types, caller can provide scale for accurate formatting.
296
    std::string to_debug_string(int scale) const;
297
298
private:
299
    std::aligned_union_t<DBMS_MIN_FIELD_SIZE - sizeof(PrimitiveType), Null, UInt64, UInt128, Int64,
300
                         Int128, IPv6, Float64, String, JsonbField, StringView, Array, Struct, Map,
301
                         VariantField, Decimal32, Decimal64, DecimalV2Value, Decimal128V3,
302
                         Decimal256, BitmapValue, HyperLogLog, QuantileState>
303
            storage;
304
305
    PrimitiveType type;
306
307
    /// Assuming there was no allocated state or it was deallocated (see destroy).
308
    template <PrimitiveType Type>
309
    void create_concrete(typename PrimitiveTypeTraits<Type>::CppType&& x);
310
    template <PrimitiveType Type>
311
    void create_concrete(const typename PrimitiveTypeTraits<Type>::CppType& x);
312
    /// Assuming same types.
313
    template <PrimitiveType Type>
314
    void assign_concrete(typename PrimitiveTypeTraits<Type>::CppType&& x);
315
    template <PrimitiveType Type>
316
    void assign_concrete(const typename PrimitiveTypeTraits<Type>::CppType& x);
317
318
    void create(const Field& field);
319
    void create(Field&& field);
320
321
    void assign(const Field& x);
322
    void assign(Field&& x);
323
324
    void destroy();
325
326
    template <PrimitiveType T>
327
    void destroy();
328
};
329
330
struct FieldWithDataType {
331
    Field field;
332
    // used for nested type of array
333
    PrimitiveType base_scalar_type_id = PrimitiveType::INVALID_TYPE;
334
    uint8_t num_dimensions = 0;
335
    int precision = -1;
336
    int scale = -1;
337
    // True when the array elements are mixed-type and must be converted to the common base
338
    // type on insert. Mirrors FieldInfo::need_convert so it survives the FieldWithDataType
339
    // round trip in the sparse read path.
340
    bool need_convert = false;
341
};
342
343
} // namespace doris
344
345
template <>
346
struct std::hash<doris::Field> {
347
7.17k
    size_t operator()(const doris::Field& field) const {
348
7.17k
        if (field.is_null()) {
349
292
            return 0;
350
292
        }
351
6.88k
        std::hash<std::string_view> hasher;
352
6.88k
        return hasher(field.as_string_view());
353
7.17k
    }
354
};