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 Tuple 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 Tuple 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 Tuple : 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 | 189k | JsonbField() = default; |
87 | 7.24M | ~JsonbField() = default; // unique_ptr will handle cleanup automatically |
88 | | |
89 | 1.60M | JsonbField(const char* ptr, size_t len) : size(len) { |
90 | 1.60M | data = std::make_unique<char[]>(size); |
91 | 1.60M | if (!data) { |
92 | 0 | throw Exception(Status::FatalError("new data buffer failed, size: {}", size)); |
93 | 0 | } |
94 | 1.60M | if (size > 0) { |
95 | 1.60M | memcpy(data.get(), ptr, size); |
96 | 1.60M | } |
97 | 1.60M | } |
98 | | |
99 | 1.66M | JsonbField(const JsonbField& x) : size(x.size) { |
100 | 1.66M | data = std::make_unique<char[]>(size); |
101 | 1.66M | if (!data) { |
102 | 0 | throw Exception(Status::FatalError("new data buffer failed, size: {}", size)); |
103 | 0 | } |
104 | 1.66M | if (size > 0) { |
105 | 1.66M | memcpy(data.get(), x.data.get(), size); |
106 | 1.66M | } |
107 | 1.66M | } |
108 | | |
109 | 3.78M | 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 | 2 | JsonbField& operator=(const JsonbField& x) { |
113 | 2 | if (this != &x) { |
114 | 2 | data = std::make_unique<char[]>(x.size); |
115 | 2 | if (!data) { |
116 | 0 | throw Exception(Status::FatalError("new data buffer failed, size: {}", x.size)); |
117 | 0 | } |
118 | 2 | if (x.size > 0) { |
119 | 1 | memcpy(data.get(), x.data.get(), x.size); |
120 | 1 | } |
121 | 2 | size = x.size; |
122 | 2 | } |
123 | 2 | return *this; |
124 | 2 | } |
125 | | |
126 | 188k | JsonbField& operator=(JsonbField&& x) noexcept { |
127 | 188k | if (this != &x) { |
128 | 188k | data = std::move(x.data); |
129 | 188k | size = x.size; |
130 | 188k | x.size = 0; |
131 | 188k | } |
132 | 188k | return *this; |
133 | 188k | } |
134 | | |
135 | 1.20M | const char* get_value() const { return data.get(); } |
136 | 1.20M | 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 | 43.4M | Field() : type(PrimitiveType::TYPE_NULL) {} |
194 | | // set Types::Null explictly and avoid other types |
195 | 85.4M | Field(PrimitiveType w) : type(w) {} |
196 | | template <PrimitiveType T> |
197 | 19.8M | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { |
198 | 19.8M | auto f = Field(T); |
199 | 19.8M | f.template create_concrete<T>(data); |
200 | 19.8M | return f; |
201 | 19.8M | } _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE23EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 310k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 310k | auto f = Field(T); | 199 | 310k | f.template create_concrete<T>(data); | 200 | 310k | return f; | 201 | 310k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE37EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 23.4k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 23.4k | auto f = Field(T); | 199 | 23.4k | f.template create_concrete<T>(data); | 200 | 23.4k | return f; | 201 | 23.4k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE41EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 6 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 6 | auto f = Field(T); | 199 | 6 | f.template create_concrete<T>(data); | 200 | 6 | return f; | 201 | 6 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE5EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 19.0M | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 19.0M | auto f = Field(T); | 199 | 19.0M | f.template create_concrete<T>(data); | 200 | 19.0M | return f; | 201 | 19.0M | } |
_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_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_13PrimitiveTypeE19EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 403 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 403 | auto f = Field(T); | 199 | 403 | f.template create_concrete<T>(data); | 200 | 403 | return f; | 201 | 403 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE17EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 48.9k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 48.9k | auto f = Field(T); | 199 | 48.9k | f.template create_concrete<T>(data); | 200 | 48.9k | return f; | 201 | 48.9k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE18EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 821 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 821 | auto f = Field(T); | 199 | 821 | f.template create_concrete<T>(data); | 200 | 821 | return f; | 201 | 821 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE16EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 27 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 27 | auto f = Field(T); | 199 | 27 | f.template create_concrete<T>(data); | 200 | 27 | return f; | 201 | 27 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE36EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 34.9k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 34.9k | auto f = Field(T); | 199 | 34.9k | f.template create_concrete<T>(data); | 200 | 34.9k | return f; | 201 | 34.9k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE6EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 40.6k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 40.6k | auto f = Field(T); | 199 | 40.6k | f.template create_concrete<T>(data); | 200 | 40.6k | return f; | 201 | 40.6k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE32EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 3 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 3 | auto f = Field(T); | 199 | 3 | f.template create_concrete<T>(data); | 200 | 3 | return f; | 201 | 3 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE25EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 6.98k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 6.98k | auto f = Field(T); | 199 | 6.98k | f.template create_concrete<T>(data); | 200 | 6.98k | return f; | 201 | 6.98k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE31EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 4 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 4 | auto f = Field(T); | 199 | 4 | f.template create_concrete<T>(data); | 200 | 4 | return f; | 201 | 4 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE26EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 54.6k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 54.6k | auto f = Field(T); | 199 | 54.6k | f.template create_concrete<T>(data); | 200 | 54.6k | return f; | 201 | 54.6k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE3EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 28.0k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 28.0k | auto f = Field(T); | 199 | 28.0k | f.template create_concrete<T>(data); | 200 | 28.0k | return f; | 201 | 28.0k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE4EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 26.1k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 26.1k | auto f = Field(T); | 199 | 26.1k | f.template create_concrete<T>(data); | 200 | 26.1k | return f; | 201 | 26.1k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE7EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 19.2k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 19.2k | auto f = Field(T); | 199 | 19.2k | f.template create_concrete<T>(data); | 200 | 19.2k | return f; | 201 | 19.2k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE8EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 22.5k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 22.5k | auto f = Field(T); | 199 | 22.5k | f.template create_concrete<T>(data); | 200 | 22.5k | return f; | 201 | 22.5k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE42EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 87 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 87 | auto f = Field(T); | 199 | 87 | f.template create_concrete<T>(data); | 200 | 87 | return f; | 201 | 87 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE2EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 2.82k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 2.82k | auto f = Field(T); | 199 | 2.82k | f.template create_concrete<T>(data); | 200 | 2.82k | return f; | 201 | 2.82k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE9EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 25.9k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 25.9k | auto f = Field(T); | 199 | 25.9k | f.template create_concrete<T>(data); | 200 | 25.9k | return f; | 201 | 25.9k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE20EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 8.54k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 8.54k | auto f = Field(T); | 199 | 8.54k | f.template create_concrete<T>(data); | 200 | 8.54k | return f; | 201 | 8.54k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE11EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 9.30k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 9.30k | auto f = Field(T); | 199 | 9.30k | f.template create_concrete<T>(data); | 200 | 9.30k | return f; | 201 | 9.30k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE12EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 14.2k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 14.2k | auto f = Field(T); | 199 | 14.2k | f.template create_concrete<T>(data); | 200 | 14.2k | return f; | 201 | 14.2k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE10EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 33.0k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 33.0k | auto f = Field(T); | 199 | 33.0k | f.template create_concrete<T>(data); | 200 | 33.0k | return f; | 201 | 33.0k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE28EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 10.3k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 10.3k | auto f = Field(T); | 199 | 10.3k | f.template create_concrete<T>(data); | 200 | 10.3k | return f; | 201 | 10.3k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE29EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 20.4k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 20.4k | auto f = Field(T); | 199 | 20.4k | f.template create_concrete<T>(data); | 200 | 20.4k | return f; | 201 | 20.4k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE30EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 23.1k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 23.1k | auto f = Field(T); | 199 | 23.1k | f.template create_concrete<T>(data); | 200 | 23.1k | return f; | 201 | 23.1k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE35EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 37.1k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 37.1k | auto f = Field(T); | 199 | 37.1k | f.template create_concrete<T>(data); | 200 | 37.1k | return f; | 201 | 37.1k | } |
Unexecuted instantiation: _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE21EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE27EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 197 | 10 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 198 | 10 | auto f = Field(T); | 199 | 10 | f.template create_concrete<T>(data); | 200 | 10 | return f; | 201 | 10 | } |
Unexecuted instantiation: _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE38EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Unexecuted instantiation: _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE39EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Unexecuted instantiation: _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE15EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE |
202 | | template <PrimitiveType T> |
203 | 61.3M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { |
204 | 61.3M | auto f = Field(T); |
205 | 61.3M | f.template create_concrete<T>(std::move(data)); |
206 | 61.3M | return f; |
207 | 61.3M | } _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE23EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 2.35M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 2.35M | auto f = Field(T); | 205 | 2.35M | f.template create_concrete<T>(std::move(data)); | 206 | 2.35M | return f; | 207 | 2.35M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE25EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 40 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 40 | auto f = Field(T); | 205 | 40 | f.template create_concrete<T>(std::move(data)); | 206 | 40 | return f; | 207 | 40 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE26EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 290 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 290 | auto f = Field(T); | 205 | 290 | f.template create_concrete<T>(std::move(data)); | 206 | 290 | return f; | 207 | 290 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE22EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 20 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 20 | auto f = Field(T); | 205 | 20 | f.template create_concrete<T>(std::move(data)); | 206 | 20 | return f; | 207 | 20 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE11EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 35 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 35 | auto f = Field(T); | 205 | 35 | f.template create_concrete<T>(std::move(data)); | 206 | 35 | return f; | 207 | 35 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE12EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 65 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 65 | auto f = Field(T); | 205 | 65 | f.template create_concrete<T>(std::move(data)); | 206 | 65 | return f; | 207 | 65 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE19EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 18 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 18 | auto f = Field(T); | 205 | 18 | f.template create_concrete<T>(std::move(data)); | 206 | 18 | return f; | 207 | 18 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE32EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 79.8k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 79.8k | auto f = Field(T); | 205 | 79.8k | f.template create_concrete<T>(std::move(data)); | 206 | 79.8k | return f; | 207 | 79.8k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE28EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 250 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 250 | auto f = Field(T); | 205 | 250 | f.template create_concrete<T>(std::move(data)); | 206 | 250 | return f; | 207 | 250 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE24EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 18 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 18 | auto f = Field(T); | 205 | 18 | f.template create_concrete<T>(std::move(data)); | 206 | 18 | return f; | 207 | 18 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE6EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 14.8M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 14.8M | auto f = Field(T); | 205 | 14.8M | f.template create_concrete<T>(std::move(data)); | 206 | 14.8M | return f; | 207 | 14.8M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE5EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 202k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 202k | auto f = Field(T); | 205 | 202k | f.template create_concrete<T>(std::move(data)); | 206 | 202k | return f; | 207 | 202k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE17EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 95.7k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 95.7k | auto f = Field(T); | 205 | 95.7k | f.template create_concrete<T>(std::move(data)); | 206 | 95.7k | return f; | 207 | 95.7k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE41EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 7 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 7 | auto f = Field(T); | 205 | 7 | f.template create_concrete<T>(std::move(data)); | 206 | 7 | return f; | 207 | 7 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE20EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 9.55k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 9.55k | auto f = Field(T); | 205 | 9.55k | f.template create_concrete<T>(std::move(data)); | 206 | 9.55k | return f; | 207 | 9.55k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE2EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 28.3M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 28.3M | auto f = Field(T); | 205 | 28.3M | f.template create_concrete<T>(std::move(data)); | 206 | 28.3M | return f; | 207 | 28.3M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE29EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 13.5M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 13.5M | auto f = Field(T); | 205 | 13.5M | f.template create_concrete<T>(std::move(data)); | 206 | 13.5M | return f; | 207 | 13.5M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE31EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 1.79M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 1.79M | auto f = Field(T); | 205 | 1.79M | f.template create_concrete<T>(std::move(data)); | 206 | 1.79M | return f; | 207 | 1.79M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE3EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 2.49k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 2.49k | auto f = Field(T); | 205 | 2.49k | f.template create_concrete<T>(std::move(data)); | 206 | 2.49k | return f; | 207 | 2.49k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE4EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 77 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 77 | auto f = Field(T); | 205 | 77 | f.template create_concrete<T>(std::move(data)); | 206 | 77 | return f; | 207 | 77 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE8EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 538 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 538 | auto f = Field(T); | 205 | 538 | f.template create_concrete<T>(std::move(data)); | 206 | 538 | return f; | 207 | 538 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE9EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 116k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 116k | auto f = Field(T); | 205 | 116k | f.template create_concrete<T>(std::move(data)); | 206 | 116k | return f; | 207 | 116k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE1EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 26.8k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 26.8k | auto f = Field(T); | 205 | 26.8k | f.template create_concrete<T>(std::move(data)); | 206 | 26.8k | return f; | 207 | 26.8k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE7EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 69 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 69 | auto f = Field(T); | 205 | 69 | f.template create_concrete<T>(std::move(data)); | 206 | 69 | return f; | 207 | 69 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE30EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 1.72k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 1.72k | auto f = Field(T); | 205 | 1.72k | f.template create_concrete<T>(std::move(data)); | 206 | 1.72k | return f; | 207 | 1.72k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE27EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 5 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 5 | auto f = Field(T); | 205 | 5 | f.template create_concrete<T>(std::move(data)); | 206 | 5 | return f; | 207 | 5 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE35EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 805 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 805 | auto f = Field(T); | 205 | 805 | f.template create_concrete<T>(std::move(data)); | 206 | 805 | return f; | 207 | 805 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE36EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 81 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 81 | auto f = Field(T); | 205 | 81 | f.template create_concrete<T>(std::move(data)); | 206 | 81 | return f; | 207 | 81 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE37EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 7 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 7 | auto f = Field(T); | 205 | 7 | f.template create_concrete<T>(std::move(data)); | 206 | 7 | return f; | 207 | 7 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE18EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 2.77k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 2.77k | auto f = Field(T); | 205 | 2.77k | f.template create_concrete<T>(std::move(data)); | 206 | 2.77k | return f; | 207 | 2.77k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE16EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 3.43k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 3.43k | auto f = Field(T); | 205 | 3.43k | f.template create_concrete<T>(std::move(data)); | 206 | 3.43k | return f; | 207 | 3.43k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE39EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 40 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 40 | auto f = Field(T); | 205 | 40 | f.template create_concrete<T>(std::move(data)); | 206 | 40 | return f; | 207 | 40 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE15EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 33 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 33 | auto f = Field(T); | 205 | 33 | f.template create_concrete<T>(std::move(data)); | 206 | 33 | return f; | 207 | 33 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE10EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 572 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 572 | auto f = Field(T); | 205 | 572 | f.template create_concrete<T>(std::move(data)); | 206 | 572 | return f; | 207 | 572 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE42EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 203 | 6 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 204 | 6 | auto f = Field(T); | 205 | 6 | f.template create_concrete<T>(std::move(data)); | 206 | 6 | return f; | 207 | 6 | } |
Unexecuted instantiation: _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE21EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE |
208 | | |
209 | | template <PrimitiveType PType, typename ValType = std::conditional_t< |
210 | | doris::is_string_type(PType), StringRef, |
211 | | typename PrimitiveTypeTraits<PType>::StorageFieldType>> |
212 | 1.39M | static Field create_field_from_olap_value(const ValType& data) { |
213 | 1.39M | auto f = Field(PType); |
214 | 1.39M | typename PrimitiveTypeTraits<PType>::CppType cpp_value; |
215 | 1.39M | if constexpr (is_string_type(PType)) { |
216 | 32.2k | auto min_size = |
217 | 32.2k | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; |
218 | 32.2k | cpp_value = String(data.data, min_size); |
219 | 32.2k | } else if constexpr (is_date_or_datetime(PType)) { |
220 | 34 | if constexpr (PType == TYPE_DATE) { |
221 | 10 | cpp_value.from_olap_date(data); |
222 | 24 | } else { |
223 | 24 | cpp_value.from_olap_datetime(data); |
224 | 24 | } |
225 | 34 | } else if constexpr (is_decimalv2(PType)) { |
226 | 6 | cpp_value = DecimalV2Value(data.integer, data.fraction); |
227 | 1.35M | } else { |
228 | 1.35M | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); |
229 | 1.35M | } |
230 | 1.39M | f.template create_concrete<PType>(std::move(cpp_value)); |
231 | 1.39M | return f; |
232 | 1.39M | } _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE3EaEES0_RKT0_ Line | Count | Source | 212 | 2.78k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 2.78k | auto f = Field(PType); | 214 | 2.78k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | 2.78k | } else { | 228 | 2.78k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | 2.78k | } | 230 | 2.78k | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 2.78k | return f; | 232 | 2.78k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE4EsEES0_RKT0_ Line | Count | Source | 212 | 24 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 24 | auto f = Field(PType); | 214 | 24 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | 24 | } else { | 228 | 24 | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | 24 | } | 230 | 24 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 24 | return f; | 232 | 24 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE5EiEES0_RKT0_ Line | Count | Source | 212 | 1.32M | static Field create_field_from_olap_value(const ValType& data) { | 213 | 1.32M | auto f = Field(PType); | 214 | 1.32M | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | 1.32M | } else { | 228 | 1.32M | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | 1.32M | } | 230 | 1.32M | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 1.32M | return f; | 232 | 1.32M | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE6ElEES0_RKT0_ Line | Count | Source | 212 | 26.3k | static Field create_field_from_olap_value(const ValType& data) { | 213 | 26.3k | auto f = Field(PType); | 214 | 26.3k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | 26.3k | } else { | 228 | 26.3k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | 26.3k | } | 230 | 26.3k | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 26.3k | return f; | 232 | 26.3k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE7EnEES0_RKT0_ Line | Count | Source | 212 | 2 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 2 | auto f = Field(PType); | 214 | 2 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | 2 | } else { | 228 | 2 | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | 2 | } | 230 | 2 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 2 | return f; | 232 | 2 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE8EfEES0_RKT0_ Line | Count | Source | 212 | 30 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 30 | auto f = Field(PType); | 214 | 30 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | 30 | } else { | 228 | 30 | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | 30 | } | 230 | 30 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 30 | return f; | 232 | 30 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE9EdEES0_RKT0_ Line | Count | Source | 212 | 22 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 22 | auto f = Field(PType); | 214 | 22 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | 22 | } else { | 228 | 22 | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | 22 | } | 230 | 22 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 22 | return f; | 232 | 22 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE15ENS_9StringRefEEES0_RKT0_ Line | Count | Source | 212 | 38 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 38 | auto f = Field(PType); | 214 | 38 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | 38 | if constexpr (is_string_type(PType)) { | 216 | 38 | auto min_size = | 217 | 38 | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | 38 | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | | } else { | 228 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | | } | 230 | 38 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 38 | return f; | 232 | 38 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE11ENS_8uint24_tEEES0_RKT0_ Line | Count | Source | 212 | 10 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 10 | auto f = Field(PType); | 214 | 10 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | 10 | } else if constexpr (is_date_or_datetime(PType)) { | 220 | 10 | if constexpr (PType == TYPE_DATE) { | 221 | 10 | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | | } else { | 228 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | | } | 230 | 10 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 10 | return f; | 232 | 10 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE12EmEES0_RKT0_ Line | Count | Source | 212 | 24 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 24 | auto f = Field(PType); | 214 | 24 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | 24 | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | 24 | } else { | 223 | 24 | cpp_value.from_olap_datetime(data); | 224 | 24 | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | | } else { | 228 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | | } | 230 | 24 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 24 | return f; | 232 | 24 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE25EjEES0_RKT0_ Line | Count | Source | 212 | 12 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 12 | auto f = Field(PType); | 214 | 12 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | 12 | } else { | 228 | 12 | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | 12 | } | 230 | 12 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 12 | return f; | 232 | 12 | } |
Unexecuted instantiation: _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE26EmEES0_RKT0_ _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE42EmEES0_RKT0_ Line | Count | Source | 212 | 64 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 64 | auto f = Field(PType); | 214 | 64 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | 64 | } else { | 228 | 64 | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | 64 | } | 230 | 64 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 64 | return f; | 232 | 64 | } |
Unexecuted instantiation: _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE36EjEES0_RKT0_ Unexecuted instantiation: _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE37EoEES0_RKT0_ _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE10ENS_9StringRefEEES0_RKT0_ Line | Count | Source | 212 | 328 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 328 | auto f = Field(PType); | 214 | 328 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | 328 | if constexpr (is_string_type(PType)) { | 216 | 328 | auto min_size = | 217 | 328 | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | 328 | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | | } else { | 228 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | | } | 230 | 328 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 328 | return f; | 232 | 328 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE23ENS_9StringRefEEES0_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 | 31.8k | if constexpr (is_string_type(PType)) { | 216 | 31.8k | auto min_size = | 217 | 31.8k | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | 31.8k | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | | } else if constexpr (is_decimalv2(PType)) { | 226 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | | } else { | 228 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | | } | 230 | 31.8k | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 31.8k | return f; | 232 | 31.8k | } |
Unexecuted instantiation: _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE28EiEES0_RKT0_ Unexecuted instantiation: _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE29ElEES0_RKT0_ Unexecuted instantiation: _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE30EnEES0_RKT0_ Unexecuted instantiation: _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE35EN4wide7integerILm256EiEEEES0_RKT0_ _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE20ENS_11decimal12_tEEES0_RKT0_ Line | Count | Source | 212 | 6 | static Field create_field_from_olap_value(const ValType& data) { | 213 | 6 | auto f = Field(PType); | 214 | 6 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 215 | | if constexpr (is_string_type(PType)) { | 216 | | auto min_size = | 217 | | MAX_ZONE_MAP_INDEX_SIZE >= data.size ? data.size : MAX_ZONE_MAP_INDEX_SIZE; | 218 | | cpp_value = String(data.data, min_size); | 219 | | } else if constexpr (is_date_or_datetime(PType)) { | 220 | | if constexpr (PType == TYPE_DATE) { | 221 | | cpp_value.from_olap_date(data); | 222 | | } else { | 223 | | cpp_value.from_olap_datetime(data); | 224 | | } | 225 | 6 | } else if constexpr (is_decimalv2(PType)) { | 226 | 6 | cpp_value = DecimalV2Value(data.integer, data.fraction); | 227 | | } else { | 228 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 229 | | } | 230 | 6 | f.template create_concrete<PType>(std::move(cpp_value)); | 231 | 6 | return f; | 232 | 6 | } |
Unexecuted instantiation: _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE2EhEES0_RKT0_ |
233 | | |
234 | | /** Despite the presence of a template constructor, this constructor is still needed, |
235 | | * since, in its absence, the compiler will still generate the default constructor. |
236 | | */ |
237 | | Field(const Field& rhs); |
238 | | |
239 | | Field(Field&& rhs); |
240 | | |
241 | | Field& operator=(const Field& rhs); |
242 | | |
243 | 1.51M | bool is_complex_field() const { |
244 | 1.51M | return type == PrimitiveType::TYPE_ARRAY || type == PrimitiveType::TYPE_MAP || |
245 | 1.51M | type == PrimitiveType::TYPE_STRUCT || type == PrimitiveType::TYPE_VARIANT; |
246 | 1.51M | } |
247 | | |
248 | 32.5M | Field& operator=(Field&& rhs) { |
249 | 32.5M | if (this != &rhs) { |
250 | 32.5M | if (type != rhs.type) { |
251 | 20.5M | destroy(); |
252 | 20.5M | create(std::move(rhs)); |
253 | 20.5M | } else { |
254 | 11.9M | assign(std::move(rhs)); |
255 | 11.9M | } |
256 | 32.5M | } |
257 | 32.5M | return *this; |
258 | 32.5M | } |
259 | | |
260 | 337M | ~Field() { destroy(); } |
261 | | |
262 | 48.9M | PrimitiveType get_type() const { return type; } |
263 | | std::string get_type_name() const; |
264 | | |
265 | 93.4M | bool is_null() const { return type == PrimitiveType::TYPE_NULL; } |
266 | | |
267 | | // The template parameter T needs to be consistent with `which`. |
268 | | // If not, use NearestFieldType<> externally. |
269 | | // Maybe modify this in the future, reference: https://github.com/ClickHouse/ClickHouse/pull/22003 |
270 | | template <PrimitiveType T> |
271 | | typename PrimitiveTypeTraits<T>::CppType& get(); |
272 | | |
273 | | template <PrimitiveType T> |
274 | | const typename PrimitiveTypeTraits<T>::CppType& get() const; |
275 | | |
276 | 2.94M | bool operator==(const Field& rhs) const { |
277 | 2.94M | return operator<=>(rhs) == std::strong_ordering::equal; |
278 | 2.94M | } |
279 | | |
280 | | std::strong_ordering operator<=>(const Field& rhs) const; |
281 | | |
282 | | std::string_view as_string_view() const; |
283 | | |
284 | | private: |
285 | | std::aligned_union_t<DBMS_MIN_FIELD_SIZE - sizeof(PrimitiveType), Null, UInt64, UInt128, Int64, |
286 | | Int128, IPv6, Float64, String, JsonbField, StringView, Array, Tuple, Map, |
287 | | VariantMap, Decimal32, Decimal64, DecimalV2Value, Decimal128V3, Decimal256, |
288 | | BitmapValue, HyperLogLog, QuantileState> |
289 | | storage; |
290 | | |
291 | | PrimitiveType type; |
292 | | |
293 | | /// Assuming there was no allocated state or it was deallocated (see destroy). |
294 | | template <PrimitiveType Type> |
295 | | void create_concrete(typename PrimitiveTypeTraits<Type>::CppType&& x); |
296 | | template <PrimitiveType Type> |
297 | | void create_concrete(const typename PrimitiveTypeTraits<Type>::CppType& x); |
298 | | /// Assuming same types. |
299 | | template <PrimitiveType Type> |
300 | | void assign_concrete(typename PrimitiveTypeTraits<Type>::CppType&& x); |
301 | | template <PrimitiveType Type> |
302 | | void assign_concrete(const typename PrimitiveTypeTraits<Type>::CppType& x); |
303 | | |
304 | | void create(const Field& field); |
305 | | void create(Field&& field); |
306 | | |
307 | | void assign(const Field& x); |
308 | | void assign(Field&& x); |
309 | | |
310 | | void destroy(); |
311 | | |
312 | | template <PrimitiveType T> |
313 | | void destroy(); |
314 | | }; |
315 | | |
316 | | struct FieldWithDataType { |
317 | | Field field; |
318 | | // used for nested type of array |
319 | | PrimitiveType base_scalar_type_id = PrimitiveType::INVALID_TYPE; |
320 | | uint8_t num_dimensions = 0; |
321 | | int precision = -1; |
322 | | int scale = -1; |
323 | | }; |
324 | | |
325 | | } // namespace doris |
326 | | |
327 | | template <> |
328 | | struct std::hash<doris::Field> { |
329 | 0 | size_t operator()(const doris::Field& field) const { |
330 | 0 | if (field.is_null()) { |
331 | 0 | return 0; |
332 | 0 | } |
333 | 0 | std::hash<std::string_view> hasher; |
334 | 0 | return hasher(field.as_string_view()); |
335 | 0 | } |
336 | | }; |