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 <cstring> |
29 | | #include <map> |
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 "util/json/path_in_data.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 | | struct FieldWithDataType; |
79 | | |
80 | | using VariantMap = std::map<PathInData, FieldWithDataType>; |
81 | | |
82 | | //TODO: rethink if we really need this? it only save one pointer from std::string |
83 | | // not POD type so could only use read/write_json_binary instead of read/write_binary |
84 | | class JsonbField { |
85 | | public: |
86 | 209k | JsonbField() = default; |
87 | 10.2M | ~JsonbField() = default; // unique_ptr will handle cleanup automatically |
88 | | |
89 | 2.30M | JsonbField(const char* ptr, size_t len) : size(len) { |
90 | 2.30M | data = std::make_unique<char[]>(size); |
91 | 2.30M | if (!data) { |
92 | 0 | throw Exception(Status::FatalError("new data buffer failed, size: {}", size)); |
93 | 0 | } |
94 | 2.30M | if (size > 0) { |
95 | 2.28M | memcpy(data.get(), ptr, size); |
96 | 2.28M | } |
97 | 2.30M | } |
98 | | |
99 | 2.45M | JsonbField(const JsonbField& x) : size(x.size) { |
100 | 2.45M | data = std::make_unique<char[]>(size); |
101 | 2.45M | if (!data) { |
102 | 0 | throw Exception(Status::FatalError("new data buffer failed, size: {}", size)); |
103 | 0 | } |
104 | 2.45M | if (size > 0) { |
105 | 2.43M | memcpy(data.get(), x.data.get(), size); |
106 | 2.43M | } |
107 | 2.45M | } |
108 | | |
109 | 5.32M | JsonbField(JsonbField&& x) noexcept : data(std::move(x.data)), size(x.size) { x.size = 0; } |
110 | | |
111 | | // dispatch for all type of storage. so need this. but not really used now. |
112 | 16 | JsonbField& operator=(const JsonbField& x) { |
113 | 16 | if (this != &x) { |
114 | 16 | data = std::make_unique<char[]>(x.size); |
115 | 16 | if (!data) { |
116 | 0 | throw Exception(Status::FatalError("new data buffer failed, size: {}", x.size)); |
117 | 0 | } |
118 | 16 | if (x.size > 0) { |
119 | 15 | memcpy(data.get(), x.data.get(), x.size); |
120 | 15 | } |
121 | 16 | size = x.size; |
122 | 16 | } |
123 | 16 | return *this; |
124 | 16 | } |
125 | | |
126 | 207k | JsonbField& operator=(JsonbField&& x) noexcept { |
127 | 207k | if (this != &x) { |
128 | 207k | data = std::move(x.data); |
129 | 207k | size = x.size; |
130 | 207k | x.size = 0; |
131 | 207k | } |
132 | 207k | return *this; |
133 | 207k | } |
134 | | |
135 | 1.88M | const char* get_value() const { return data.get(); } |
136 | 1.90M | size_t get_size() const { return size; } |
137 | | |
138 | 0 | bool operator<(const JsonbField& r) const { |
139 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
140 | 0 | } |
141 | 0 | bool operator<=(const JsonbField& r) const { |
142 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
143 | 0 | } |
144 | 0 | bool operator==(const JsonbField& r) const { |
145 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
146 | 0 | } |
147 | 0 | bool operator>(const JsonbField& r) const { |
148 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
149 | 0 | } |
150 | 0 | bool operator>=(const JsonbField& r) const { |
151 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
152 | 0 | } |
153 | 0 | bool operator!=(const JsonbField& r) const { |
154 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
155 | 0 | } |
156 | | |
157 | 0 | const JsonbField& operator+=(const JsonbField& r) { |
158 | 0 | throw Exception(Status::FatalError("Not support plus opration on JsonbField")); |
159 | 0 | } |
160 | | |
161 | 0 | const JsonbField& operator-=(const JsonbField& r) { |
162 | 0 | throw Exception(Status::FatalError("Not support minus opration on JsonbField")); |
163 | 0 | } |
164 | | |
165 | | private: |
166 | | std::unique_ptr<char[]> data = nullptr; |
167 | | size_t size = 0; |
168 | | }; |
169 | | |
170 | | template <typename T> |
171 | | bool decimal_equal(T x, T y, UInt32 x_scale, UInt32 y_scale); |
172 | | template <typename T> |
173 | | bool decimal_less(T x, T y, UInt32 x_scale, UInt32 y_scale); |
174 | | template <typename T> |
175 | | bool decimal_less_or_equal(T x, T y, UInt32 x_scale, UInt32 y_scale); |
176 | | |
177 | | /** 32 is enough. Round number is used for alignment and for better arithmetic inside std::vector. |
178 | | * NOTE: Actually, sizeof(std::string) is 32 when using libc++, so Field is 40 bytes. |
179 | | */ |
180 | | constexpr size_t DBMS_MIN_FIELD_SIZE = 32; |
181 | | |
182 | | /** Discriminated union of several types. |
183 | | * Made for replacement of `boost::variant` |
184 | | * is not generalized, |
185 | | * but somewhat more efficient, and simpler. |
186 | | * |
187 | | * Used to represent a single value of one of several types in memory. |
188 | | * Warning! Prefer to use chunks of columns instead of single values. See Column.h |
189 | | */ |
190 | | class Field { |
191 | | public: |
192 | | static const int MIN_NON_POD = 16; |
193 | 151M | Field() : type(PrimitiveType::TYPE_NULL) {} |
194 | | // set Types::Null explictly and avoid other types |
195 | 164M | Field(PrimitiveType w) : type(w) {} |
196 | | template <PrimitiveType T> |
197 | 44.9M | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { |
198 | 44.9M | auto f = Field(T); |
199 | 44.9M | f.template create_concrete<T>(data); |
200 | 44.9M | return f; |
201 | 44.9M | } _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE23EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 19.1M | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 19.1M | auto f = Field(T); | 199 | 19.1M | f.template create_concrete<T>(data); | 200 | 19.1M | return f; | 201 | 19.1M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE37EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 28.1k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 28.1k | auto f = Field(T); | 199 | 28.1k | f.template create_concrete<T>(data); | 200 | 28.1k | return f; | 201 | 28.1k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE41EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 7 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 7 | auto f = Field(T); | 199 | 7 | f.template create_concrete<T>(data); | 200 | 7 | return f; | 201 | 7 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE5EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 19.7M | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 19.7M | auto f = Field(T); | 199 | 19.7M | f.template create_concrete<T>(data); | 200 | 19.7M | return f; | 201 | 19.7M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE15EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 1.14k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 1.14k | auto f = Field(T); | 199 | 1.14k | f.template create_concrete<T>(data); | 200 | 1.14k | return f; | 201 | 1.14k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE2EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 150k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 150k | auto f = Field(T); | 199 | 150k | f.template create_concrete<T>(data); | 200 | 150k | return f; | 201 | 150k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE3EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 480k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 480k | auto f = Field(T); | 199 | 480k | f.template create_concrete<T>(data); | 200 | 480k | return f; | 201 | 480k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE4EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 71.4k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 71.4k | auto f = Field(T); | 199 | 71.4k | f.template create_concrete<T>(data); | 200 | 71.4k | return f; | 201 | 71.4k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE6EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 3.05M | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 3.05M | auto f = Field(T); | 199 | 3.05M | f.template create_concrete<T>(data); | 200 | 3.05M | return f; | 201 | 3.05M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE7EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 41.7k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 41.7k | auto f = Field(T); | 199 | 41.7k | f.template create_concrete<T>(data); | 200 | 41.7k | return f; | 201 | 41.7k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE8EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 49.2k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 49.2k | auto f = Field(T); | 199 | 49.2k | f.template create_concrete<T>(data); | 200 | 49.2k | return f; | 201 | 49.2k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE9EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 195k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 195k | auto f = Field(T); | 199 | 195k | f.template create_concrete<T>(data); | 200 | 195k | return f; | 201 | 195k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE36EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 37.9k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 37.9k | auto f = Field(T); | 199 | 37.9k | f.template create_concrete<T>(data); | 200 | 37.9k | return f; | 201 | 37.9k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE11EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 28.3k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 28.3k | auto f = Field(T); | 199 | 28.3k | f.template create_concrete<T>(data); | 200 | 28.3k | return f; | 201 | 28.3k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE25EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 654k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 654k | auto f = Field(T); | 199 | 654k | f.template create_concrete<T>(data); | 200 | 654k | return f; | 201 | 654k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE12EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 14.9k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 14.9k | auto f = Field(T); | 199 | 14.9k | f.template create_concrete<T>(data); | 200 | 14.9k | return f; | 201 | 14.9k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE26EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 116k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 116k | auto f = Field(T); | 199 | 116k | f.template create_concrete<T>(data); | 200 | 116k | return f; | 201 | 116k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE27EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 128 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 128 | auto f = Field(T); | 199 | 128 | f.template create_concrete<T>(data); | 200 | 128 | return f; | 201 | 128 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE42EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 16.7k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 16.7k | auto f = Field(T); | 199 | 16.7k | f.template create_concrete<T>(data); | 200 | 16.7k | return f; | 201 | 16.7k | } |
Unexecuted instantiation: _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE38EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Unexecuted instantiation: _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE39EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE28EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 24.8k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 24.8k | auto f = Field(T); | 199 | 24.8k | f.template create_concrete<T>(data); | 200 | 24.8k | return f; | 201 | 24.8k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE29EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 179k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 179k | auto f = Field(T); | 199 | 179k | f.template create_concrete<T>(data); | 200 | 179k | return f; | 201 | 179k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE20EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 8.86k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 8.86k | auto f = Field(T); | 199 | 8.86k | f.template create_concrete<T>(data); | 200 | 8.86k | return f; | 201 | 8.86k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE30EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 33.8k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 33.8k | auto f = Field(T); | 199 | 33.8k | f.template create_concrete<T>(data); | 200 | 33.8k | return f; | 201 | 33.8k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE35EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 40.8k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 40.8k | auto f = Field(T); | 199 | 40.8k | f.template create_concrete<T>(data); | 200 | 40.8k | return f; | 201 | 40.8k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE17EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 165k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 165k | auto f = Field(T); | 199 | 165k | f.template create_concrete<T>(data); | 200 | 165k | return f; | 201 | 165k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE24EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 22.3k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 22.3k | auto f = Field(T); | 199 | 22.3k | f.template create_concrete<T>(data); | 200 | 22.3k | return f; | 201 | 22.3k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE22EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 2.42k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 2.42k | auto f = Field(T); | 199 | 2.42k | f.template create_concrete<T>(data); | 200 | 2.42k | return f; | 201 | 2.42k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE19EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 404 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 404 | auto f = Field(T); | 199 | 404 | f.template create_concrete<T>(data); | 200 | 404 | return f; | 201 | 404 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE10EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 596k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 596k | auto f = Field(T); | 199 | 596k | f.template create_concrete<T>(data); | 200 | 596k | return f; | 201 | 596k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE31EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 1.44k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 1.44k | auto f = Field(T); | 199 | 1.44k | f.template create_concrete<T>(data); | 200 | 1.44k | return f; | 201 | 1.44k | } |
|
202 | | template <PrimitiveType T> |
203 | 108M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { |
204 | 108M | auto f = Field(T); |
205 | 108M | f.template create_concrete<T>(std::move(data)); |
206 | 108M | return f; |
207 | 108M | } _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE23EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 15.8M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 15.8M | auto f = Field(T); | 205 | 15.8M | f.template create_concrete<T>(std::move(data)); | 206 | 15.8M | return f; | 207 | 15.8M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE28EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 50.6k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 50.6k | auto f = Field(T); | 205 | 50.6k | f.template create_concrete<T>(std::move(data)); | 206 | 50.6k | return f; | 207 | 50.6k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE29EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 13.6M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 13.6M | auto f = Field(T); | 205 | 13.6M | f.template create_concrete<T>(std::move(data)); | 206 | 13.6M | return f; | 207 | 13.6M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE20EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 10.5k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 10.5k | auto f = Field(T); | 205 | 10.5k | f.template create_concrete<T>(std::move(data)); | 206 | 10.5k | return f; | 207 | 10.5k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE35EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 11.3k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 11.3k | auto f = Field(T); | 205 | 11.3k | f.template create_concrete<T>(std::move(data)); | 206 | 11.3k | return f; | 207 | 11.3k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE30EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 158k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 158k | auto f = Field(T); | 205 | 158k | f.template create_concrete<T>(std::move(data)); | 206 | 158k | return f; | 207 | 158k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE1EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 59.6k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 59.6k | auto f = Field(T); | 205 | 59.6k | f.template create_concrete<T>(std::move(data)); | 206 | 59.6k | return f; | 207 | 59.6k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE31EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 2.51M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 2.51M | auto f = Field(T); | 205 | 2.51M | f.template create_concrete<T>(std::move(data)); | 206 | 2.51M | return f; | 207 | 2.51M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE2EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 28.6M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 28.6M | auto f = Field(T); | 205 | 28.6M | f.template create_concrete<T>(std::move(data)); | 206 | 28.6M | return f; | 207 | 28.6M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE3EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 7.29M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 7.29M | auto f = Field(T); | 205 | 7.29M | f.template create_concrete<T>(std::move(data)); | 206 | 7.29M | return f; | 207 | 7.29M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE4EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 99.1k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 99.1k | auto f = Field(T); | 205 | 99.1k | f.template create_concrete<T>(std::move(data)); | 206 | 99.1k | return f; | 207 | 99.1k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE5EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 1.81M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 1.81M | auto f = Field(T); | 205 | 1.81M | f.template create_concrete<T>(std::move(data)); | 206 | 1.81M | return f; | 207 | 1.81M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE6EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 29.1M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 29.1M | auto f = Field(T); | 205 | 29.1M | f.template create_concrete<T>(std::move(data)); | 206 | 29.1M | return f; | 207 | 29.1M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE7EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 130k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 130k | auto f = Field(T); | 205 | 130k | f.template create_concrete<T>(std::move(data)); | 206 | 130k | return f; | 207 | 130k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE8EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 54.6k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 54.6k | auto f = Field(T); | 205 | 54.6k | f.template create_concrete<T>(std::move(data)); | 206 | 54.6k | return f; | 207 | 54.6k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE9EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 2.97M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 2.97M | auto f = Field(T); | 205 | 2.97M | f.template create_concrete<T>(std::move(data)); | 206 | 2.97M | return f; | 207 | 2.97M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE11EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 6.94k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 6.94k | auto f = Field(T); | 205 | 6.94k | f.template create_concrete<T>(std::move(data)); | 206 | 6.94k | return f; | 207 | 6.94k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE25EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 238k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 238k | auto f = Field(T); | 205 | 238k | f.template create_concrete<T>(std::move(data)); | 206 | 238k | return f; | 207 | 238k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE12EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 7.23k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 7.23k | auto f = Field(T); | 205 | 7.23k | f.template create_concrete<T>(std::move(data)); | 206 | 7.23k | return f; | 207 | 7.23k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE26EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 2.49M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 2.49M | auto f = Field(T); | 205 | 2.49M | f.template create_concrete<T>(std::move(data)); | 206 | 2.49M | return f; | 207 | 2.49M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE36EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 5.26k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 5.26k | auto f = Field(T); | 205 | 5.26k | f.template create_concrete<T>(std::move(data)); | 206 | 5.26k | return f; | 207 | 5.26k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE37EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 2.82k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 2.82k | auto f = Field(T); | 205 | 2.82k | f.template create_concrete<T>(std::move(data)); | 206 | 2.82k | return f; | 207 | 2.82k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE27EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 3 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 3 | auto f = Field(T); | 205 | 3 | f.template create_concrete<T>(std::move(data)); | 206 | 3 | return f; | 207 | 3 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE42EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 31.5k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 31.5k | auto f = Field(T); | 205 | 31.5k | f.template create_concrete<T>(std::move(data)); | 206 | 31.5k | return f; | 207 | 31.5k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE15EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 92.3k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 92.3k | auto f = Field(T); | 205 | 92.3k | f.template create_concrete<T>(std::move(data)); | 206 | 92.3k | return f; | 207 | 92.3k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE17EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 2.20M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 2.20M | auto f = Field(T); | 205 | 2.20M | f.template create_concrete<T>(std::move(data)); | 206 | 2.20M | return f; | 207 | 2.20M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE41EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 50 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 50 | auto f = Field(T); | 205 | 50 | f.template create_concrete<T>(std::move(data)); | 206 | 50 | return f; | 207 | 50 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE22EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 46 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 46 | auto f = Field(T); | 205 | 46 | f.template create_concrete<T>(std::move(data)); | 206 | 46 | return f; | 207 | 46 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE24EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 10 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 10 | auto f = Field(T); | 205 | 10 | f.template create_concrete<T>(std::move(data)); | 206 | 10 | return f; | 207 | 10 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE19EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 10 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 10 | auto f = Field(T); | 205 | 10 | f.template create_concrete<T>(std::move(data)); | 206 | 10 | return f; | 207 | 10 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE18EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 22.2k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 22.2k | auto f = Field(T); | 205 | 22.2k | f.template create_concrete<T>(std::move(data)); | 206 | 22.2k | return f; | 207 | 22.2k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE16EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 5.95k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 5.95k | auto f = Field(T); | 205 | 5.95k | f.template create_concrete<T>(std::move(data)); | 206 | 5.95k | return f; | 207 | 5.95k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE32EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 153k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 153k | auto f = Field(T); | 205 | 153k | f.template create_concrete<T>(std::move(data)); | 206 | 153k | return f; | 207 | 153k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE10EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 861k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 861k | auto f = Field(T); | 205 | 861k | f.template create_concrete<T>(std::move(data)); | 206 | 861k | return f; | 207 | 861k | } |
|
208 | | |
209 | | template <PrimitiveType PType, typename ValType = std::conditional_t< |
210 | | doris::is_string_type(PType), StringRef, |
211 | | typename PrimitiveTypeTraits<PType>::StorageFieldType>> |
212 | 1.59M | static Field create_field_from_olap_value(const ValType& data) { |
213 | 1.59M | auto f = Field(PType); |
214 | 1.59M | typename PrimitiveTypeTraits<PType>::CppType cpp_value; |
215 | 1.59M | if constexpr (is_string_type(PType)) { |
216 | 552k | cpp_value = String(data.data, data.size); |
217 | 552k | } else if constexpr (is_date_or_datetime(PType)) { |
218 | 1.15k | if constexpr (PType == TYPE_DATE) { |
219 | 463 | cpp_value.from_olap_date(data); |
220 | 691 | } else { |
221 | 691 | cpp_value.from_olap_datetime(data); |
222 | 691 | } |
223 | 1.15k | } else if constexpr (is_decimalv2(PType)) { |
224 | 155 | cpp_value = DecimalV2Value(data.integer, data.fraction); |
225 | 1.04M | } else { |
226 | 1.04M | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); |
227 | 1.04M | } |
228 | 1.59M | f.template create_concrete<PType>(std::move(cpp_value)); |
229 | 1.59M | return f; |
230 | 1.59M | } _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE3EaEES0_RKT0_ Line | Count | Source | 212 | 81.7k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 81.7k | auto f = Field(PType); | 214 | 81.7k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 81.7k | } else { | 226 | 81.7k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 81.7k | } | 228 | 81.7k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 81.7k | return f; | 230 | 81.7k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE4EsEES0_RKT0_ Line | Count | Source | 212 | 23.5k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 23.5k | auto f = Field(PType); | 214 | 23.5k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 23.5k | } else { | 226 | 23.5k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 23.5k | } | 228 | 23.5k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 23.5k | return f; | 230 | 23.5k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE5EiEES0_RKT0_ Line | Count | Source | 212 | 193k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 193k | auto f = Field(PType); | 214 | 193k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 193k | } else { | 226 | 193k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 193k | } | 228 | 193k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 193k | return f; | 230 | 193k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE6ElEES0_RKT0_ Line | Count | Source | 212 | 449k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 449k | auto f = Field(PType); | 214 | 449k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 449k | } else { | 226 | 449k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 449k | } | 228 | 449k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 449k | return f; | 230 | 449k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE7EnEES0_RKT0_ Line | Count | Source | 212 | 32.5k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 32.5k | auto f = Field(PType); | 214 | 32.5k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 32.5k | } else { | 226 | 32.5k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 32.5k | } | 228 | 32.5k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 32.5k | return f; | 230 | 32.5k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE8EfEES0_RKT0_ Line | Count | Source | 212 | 14.1k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 14.1k | auto f = Field(PType); | 214 | 14.1k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 14.1k | } else { | 226 | 14.1k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 14.1k | } | 228 | 14.1k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 14.1k | return f; | 230 | 14.1k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE9EdEES0_RKT0_ Line | Count | Source | 212 | 28.3k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 28.3k | auto f = Field(PType); | 214 | 28.3k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 28.3k | } else { | 226 | 28.3k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 28.3k | } | 228 | 28.3k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 28.3k | return f; | 230 | 28.3k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE15ENS_9StringRefEEES0_RKT0_ Line | Count | Source | 212 | 33.2k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 33.2k | auto f = Field(PType); | 214 | 33.2k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | 33.2k | if constexpr (is_string_type(PType)) { | 216 | 33.2k | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | | } else { | 226 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | | } | 228 | 33.2k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 33.2k | return f; | 230 | 33.2k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE11ENS_8uint24_tEEES0_RKT0_ Line | Count | Source | 212 | 463 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 463 | auto f = Field(PType); | 214 | 463 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | 463 | } else if constexpr (is_date_or_datetime(PType)) { | 218 | 463 | if constexpr (PType == TYPE_DATE) { | 219 | 463 | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | | } else { | 226 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | | } | 228 | 463 | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 463 | return f; | 230 | 463 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE12EmEES0_RKT0_ Line | Count | Source | 212 | 691 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 691 | auto f = Field(PType); | 214 | 691 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | 691 | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | 691 | } else { | 221 | 691 | cpp_value.from_olap_datetime(data); | 222 | 691 | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | | } else { | 226 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | | } | 228 | 691 | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 691 | return f; | 230 | 691 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE25EjEES0_RKT0_ Line | Count | Source | 212 | 61.0k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 61.0k | auto f = Field(PType); | 214 | 61.0k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 61.0k | } else { | 226 | 61.0k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 61.0k | } | 228 | 61.0k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 61.0k | return f; | 230 | 61.0k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE26EmEES0_RKT0_ Line | Count | Source | 212 | 68.5k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 68.5k | auto f = Field(PType); | 214 | 68.5k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 68.5k | } else { | 226 | 68.5k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 68.5k | } | 228 | 68.5k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 68.5k | return f; | 230 | 68.5k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE42EmEES0_RKT0_ Line | Count | Source | 212 | 6.50k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 6.50k | auto f = Field(PType); | 214 | 6.50k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 6.50k | } else { | 226 | 6.50k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 6.50k | } | 228 | 6.50k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 6.50k | return f; | 230 | 6.50k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE36EjEES0_RKT0_ Line | Count | Source | 212 | 1.17k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 1.17k | auto f = Field(PType); | 214 | 1.17k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 1.17k | } else { | 226 | 1.17k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 1.17k | } | 228 | 1.17k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 1.17k | return f; | 230 | 1.17k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE37EoEES0_RKT0_ Line | Count | Source | 212 | 1.02k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 1.02k | auto f = Field(PType); | 214 | 1.02k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 1.02k | } else { | 226 | 1.02k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 1.02k | } | 228 | 1.02k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 1.02k | return f; | 230 | 1.02k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE10ENS_9StringRefEEES0_RKT0_ Line | Count | Source | 212 | 307k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 307k | auto f = Field(PType); | 214 | 307k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | 307k | if constexpr (is_string_type(PType)) { | 216 | 307k | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | | } else { | 226 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | | } | 228 | 307k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 307k | return f; | 230 | 307k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE23ENS_9StringRefEEES0_RKT0_ Line | Count | Source | 212 | 211k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 211k | auto f = Field(PType); | 214 | 211k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | 211k | if constexpr (is_string_type(PType)) { | 216 | 211k | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | | } else { | 226 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | | } | 228 | 211k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 211k | return f; | 230 | 211k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE28EiEES0_RKT0_ Line | Count | Source | 212 | 6.95k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 6.95k | auto f = Field(PType); | 214 | 6.95k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 6.95k | } else { | 226 | 6.95k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 6.95k | } | 228 | 6.95k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 6.95k | return f; | 230 | 6.95k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE29ElEES0_RKT0_ Line | Count | Source | 212 | 31.8k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 31.8k | auto f = Field(PType); | 214 | 31.8k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 31.8k | } else { | 226 | 31.8k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 31.8k | } | 228 | 31.8k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 31.8k | return f; | 230 | 31.8k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE30EnEES0_RKT0_ Line | Count | Source | 212 | 20.7k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 20.7k | auto f = Field(PType); | 214 | 20.7k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 20.7k | } else { | 226 | 20.7k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 20.7k | } | 228 | 20.7k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 20.7k | return f; | 230 | 20.7k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE35EN4wide7integerILm256EiEEEES0_RKT0_ Line | Count | Source | 212 | 1.05k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 1.05k | auto f = Field(PType); | 214 | 1.05k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 1.05k | } else { | 226 | 1.05k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 1.05k | } | 228 | 1.05k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 1.05k | return f; | 230 | 1.05k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE20ENS_11decimal12_tEEES0_RKT0_ Line | Count | Source | 212 | 155 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 155 | auto f = Field(PType); | 214 | 155 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | 155 | } else if constexpr (is_decimalv2(PType)) { | 224 | 155 | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | | } else { | 226 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | | } | 228 | 155 | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 155 | return f; | 230 | 155 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE2EhEES0_RKT0_ Line | Count | Source | 212 | 20.9k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 20.9k | auto f = Field(PType); | 214 | 20.9k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | cpp_value = String(data.data, data.size); | 217 | | } else if constexpr (is_date_or_datetime(PType)) { | 218 | | if constexpr (PType == TYPE_DATE) { | 219 | | cpp_value.from_olap_date(data); | 220 | | } else { | 221 | | cpp_value.from_olap_datetime(data); | 222 | | } | 223 | | } else if constexpr (is_decimalv2(PType)) { | 224 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 225 | 20.9k | } else { | 226 | 20.9k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 227 | 20.9k | } | 228 | 20.9k | f.template create_concrete<PType>(std::move(cpp_value)); | 229 | 20.9k | return f; | 230 | 20.9k | } |
|
231 | | |
232 | | /** Despite the presence of a template constructor, this constructor is still needed, |
233 | | * since, in its absence, the compiler will still generate the default constructor. |
234 | | */ |
235 | | Field(const Field& rhs); |
236 | | |
237 | | Field(Field&& rhs); |
238 | | |
239 | | Field& operator=(const Field& rhs); |
240 | | |
241 | 22.3M | bool is_complex_field() const { |
242 | 22.3M | return type == PrimitiveType::TYPE_ARRAY || type == PrimitiveType::TYPE_MAP || |
243 | 22.3M | type == PrimitiveType::TYPE_STRUCT || type == PrimitiveType::TYPE_VARIANT; |
244 | 22.3M | } |
245 | | |
246 | 110M | Field& operator=(Field&& rhs) { |
247 | 110M | if (this != &rhs) { |
248 | 110M | if (type != rhs.type) { |
249 | 74.0M | destroy(); |
250 | 74.0M | create(std::move(rhs)); |
251 | 74.0M | } else { |
252 | 36.7M | assign(std::move(rhs)); |
253 | 36.7M | } |
254 | 110M | } |
255 | 110M | return *this; |
256 | 110M | } |
257 | | |
258 | 589M | ~Field() { destroy(); } |
259 | | |
260 | 135M | PrimitiveType get_type() const { return type; } |
261 | | std::string get_type_name() const; |
262 | | |
263 | 209M | bool is_null() const { return type == PrimitiveType::TYPE_NULL; } |
264 | | |
265 | | // The template parameter T needs to be consistent with `which`. |
266 | | // If not, use NearestFieldType<> externally. |
267 | | // Maybe modify this in the future, reference: https://github.com/ClickHouse/ClickHouse/pull/22003 |
268 | | template <PrimitiveType T> |
269 | | typename PrimitiveTypeTraits<T>::CppType& get(); |
270 | | |
271 | | template <PrimitiveType T> |
272 | | const typename PrimitiveTypeTraits<T>::CppType& get() const; |
273 | | |
274 | 9.67M | bool operator==(const Field& rhs) const { |
275 | 9.67M | return operator<=>(rhs) == std::strong_ordering::equal; |
276 | 9.67M | } |
277 | | |
278 | | std::strong_ordering operator<=>(const Field& rhs) const; |
279 | | |
280 | | std::string_view as_string_view() const; |
281 | | |
282 | | // Return a human-readable representation of the stored value for debugging. |
283 | | // Unlike get_type_name() which returns the type, this prints the actual value. |
284 | | // For decimal types, caller can provide scale for accurate formatting. |
285 | | std::string to_debug_string(int scale) const; |
286 | | |
287 | | private: |
288 | | std::aligned_union_t<DBMS_MIN_FIELD_SIZE - sizeof(PrimitiveType), Null, UInt64, UInt128, Int64, |
289 | | Int128, IPv6, Float64, String, JsonbField, StringView, Array, Struct, Map, |
290 | | VariantMap, Decimal32, Decimal64, DecimalV2Value, Decimal128V3, Decimal256, |
291 | | BitmapValue, HyperLogLog, QuantileState> |
292 | | storage; |
293 | | |
294 | | PrimitiveType type; |
295 | | |
296 | | /// Assuming there was no allocated state or it was deallocated (see destroy). |
297 | | template <PrimitiveType Type> |
298 | | void create_concrete(typename PrimitiveTypeTraits<Type>::CppType&& x); |
299 | | template <PrimitiveType Type> |
300 | | void create_concrete(const typename PrimitiveTypeTraits<Type>::CppType& x); |
301 | | /// Assuming same types. |
302 | | template <PrimitiveType Type> |
303 | | void assign_concrete(typename PrimitiveTypeTraits<Type>::CppType&& x); |
304 | | template <PrimitiveType Type> |
305 | | void assign_concrete(const typename PrimitiveTypeTraits<Type>::CppType& x); |
306 | | |
307 | | void create(const Field& field); |
308 | | void create(Field&& field); |
309 | | |
310 | | void assign(const Field& x); |
311 | | void assign(Field&& x); |
312 | | |
313 | | void destroy(); |
314 | | |
315 | | template <PrimitiveType T> |
316 | | void destroy(); |
317 | | }; |
318 | | |
319 | | struct FieldWithDataType { |
320 | | Field field; |
321 | | // used for nested type of array |
322 | | PrimitiveType base_scalar_type_id = PrimitiveType::INVALID_TYPE; |
323 | | uint8_t num_dimensions = 0; |
324 | | int precision = -1; |
325 | | int scale = -1; |
326 | | }; |
327 | | |
328 | | } // namespace doris |
329 | | |
330 | | template <> |
331 | | struct std::hash<doris::Field> { |
332 | 1.52k | size_t operator()(const doris::Field& field) const { |
333 | 1.52k | if (field.is_null()) { |
334 | 158 | return 0; |
335 | 158 | } |
336 | 1.36k | std::hash<std::string_view> hasher; |
337 | 1.36k | return hasher(field.as_string_view()); |
338 | 1.52k | } |
339 | | }; |