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 <string> |
30 | | #include <string_view> |
31 | | #include <type_traits> |
32 | | #include <utility> |
33 | | #include <vector> |
34 | | |
35 | | #include "common/compiler_util.h" // IWYU pragma: keep |
36 | | #include "common/exception.h" |
37 | | #include "core/data_type/primitive_type.h" |
38 | | #include "core/string_view.h" |
39 | | #include "core/types.h" |
40 | | #include "core/uint128.h" |
41 | | #include "core/value/bitmap_value.h" |
42 | | #include "core/value/hll.h" |
43 | | #include "core/value/quantile_state.h" |
44 | | #include "core/value/variant/variant_field.h" |
45 | | |
46 | | namespace doris { |
47 | | template <PrimitiveType type> |
48 | | struct PrimitiveTypeTraits; |
49 | | template <typename T> |
50 | | struct TypeName; |
51 | | struct PackedInt128; |
52 | | } // namespace doris |
53 | | |
54 | | namespace doris { |
55 | | |
56 | | class Field; |
57 | | |
58 | | using FieldVector = std::vector<Field>; |
59 | | |
60 | | /// Array and Struct use the same storage type -- FieldVector, but we declare |
61 | | /// distinct types for them, so that the caller can choose whether it wants to |
62 | | /// construct a Field of Array or a Struct type. An alternative approach would be |
63 | | /// to construct both of these types from FieldVector, and have the caller |
64 | | /// specify the desired Field type explicitly. |
65 | | struct Array : public FieldVector { |
66 | | using FieldVector::FieldVector; |
67 | | }; |
68 | | |
69 | | struct Struct : public FieldVector { |
70 | | using FieldVector::FieldVector; |
71 | | }; |
72 | | |
73 | | struct Map : public FieldVector { |
74 | | using FieldVector::FieldVector; |
75 | | }; |
76 | | |
77 | | //TODO: rethink if we really need this? it only save one pointer from std::string |
78 | | // not POD type so could only use read/write_json_binary instead of read/write_binary |
79 | | class JsonbField { |
80 | | public: |
81 | 209k | JsonbField() = default; |
82 | 10.2M | ~JsonbField() = default; // unique_ptr will handle cleanup automatically |
83 | | |
84 | 2.30M | JsonbField(const char* ptr, size_t len) : size(len) { |
85 | 2.30M | data = std::make_unique<char[]>(size); |
86 | 2.30M | if (!data) { |
87 | 0 | throw Exception(Status::FatalError("new data buffer failed, size: {}", size)); |
88 | 0 | } |
89 | 2.30M | if (size > 0) { |
90 | 2.29M | memcpy(data.get(), ptr, size); |
91 | 2.29M | } |
92 | 2.30M | } |
93 | | |
94 | 2.44M | JsonbField(const JsonbField& x) : size(x.size) { |
95 | 2.44M | data = std::make_unique<char[]>(size); |
96 | 2.44M | if (!data) { |
97 | 0 | throw Exception(Status::FatalError("new data buffer failed, size: {}", size)); |
98 | 0 | } |
99 | 2.44M | if (size > 0) { |
100 | 2.43M | memcpy(data.get(), x.data.get(), size); |
101 | 2.43M | } |
102 | 2.44M | } |
103 | | |
104 | 5.30M | JsonbField(JsonbField&& x) noexcept : data(std::move(x.data)), size(x.size) { x.size = 0; } |
105 | | |
106 | | // dispatch for all type of storage. so need this. but not really used now. |
107 | 20 | JsonbField& operator=(const JsonbField& x) { |
108 | 20 | if (this != &x) { |
109 | 20 | data = std::make_unique<char[]>(x.size); |
110 | 20 | if (!data) { |
111 | 0 | throw Exception(Status::FatalError("new data buffer failed, size: {}", x.size)); |
112 | 0 | } |
113 | 20 | if (x.size > 0) { |
114 | 19 | memcpy(data.get(), x.data.get(), x.size); |
115 | 19 | } |
116 | 20 | size = x.size; |
117 | 20 | } |
118 | 20 | return *this; |
119 | 20 | } |
120 | | |
121 | 207k | JsonbField& operator=(JsonbField&& x) noexcept { |
122 | 207k | if (this != &x) { |
123 | 207k | data = std::move(x.data); |
124 | 207k | size = x.size; |
125 | 207k | x.size = 0; |
126 | 207k | } |
127 | 207k | return *this; |
128 | 207k | } |
129 | | |
130 | 1.88M | const char* get_value() const { return data.get(); } |
131 | 1.93M | size_t get_size() const { return size; } |
132 | | |
133 | 0 | bool operator<(const JsonbField& r) const { |
134 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
135 | 0 | } |
136 | 0 | bool operator<=(const JsonbField& r) const { |
137 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
138 | 0 | } |
139 | 0 | bool operator==(const JsonbField& r) const { |
140 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
141 | 0 | } |
142 | 0 | bool operator>(const JsonbField& r) const { |
143 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
144 | 0 | } |
145 | 0 | bool operator>=(const JsonbField& r) const { |
146 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
147 | 0 | } |
148 | 0 | bool operator!=(const JsonbField& r) const { |
149 | 0 | throw Exception(Status::FatalError("comparing between JsonbField is not supported")); |
150 | 0 | } |
151 | | |
152 | 0 | const JsonbField& operator+=(const JsonbField& r) { |
153 | 0 | throw Exception(Status::FatalError("Not support plus opration on JsonbField")); |
154 | 0 | } |
155 | | |
156 | 0 | const JsonbField& operator-=(const JsonbField& r) { |
157 | 0 | throw Exception(Status::FatalError("Not support minus opration on JsonbField")); |
158 | 0 | } |
159 | | |
160 | | private: |
161 | | std::unique_ptr<char[]> data = nullptr; |
162 | | size_t size = 0; |
163 | | }; |
164 | | |
165 | | template <typename T> |
166 | | bool decimal_equal(T x, T y, UInt32 x_scale, UInt32 y_scale); |
167 | | template <typename T> |
168 | | bool decimal_less(T x, T y, UInt32 x_scale, UInt32 y_scale); |
169 | | template <typename T> |
170 | | bool decimal_less_or_equal(T x, T y, UInt32 x_scale, UInt32 y_scale); |
171 | | |
172 | | /** 32 is enough. Round number is used for alignment and for better arithmetic inside std::vector. |
173 | | * NOTE: Actually, sizeof(std::string) is 32 when using libc++, so Field is 40 bytes. |
174 | | */ |
175 | | constexpr size_t DBMS_MIN_FIELD_SIZE = 32; |
176 | | |
177 | | /** Discriminated union of several types. |
178 | | * Made for replacement of `boost::variant` |
179 | | * is not generalized, |
180 | | * but somewhat more efficient, and simpler. |
181 | | * |
182 | | * Used to represent a single value of one of several types in memory. |
183 | | * Warning! Prefer to use chunks of columns instead of single values. See Column.h |
184 | | */ |
185 | | class Field { |
186 | | public: |
187 | | static const int MIN_NON_POD = 16; |
188 | 137M | Field() : type(PrimitiveType::TYPE_NULL) {} |
189 | | // set Types::Null explictly and avoid other types |
190 | 158M | Field(PrimitiveType w) : type(w) {} |
191 | | template <PrimitiveType T> |
192 | 38.3M | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { |
193 | 38.3M | auto f = Field(T); |
194 | 38.3M | f.template create_concrete<T>(data); |
195 | 38.3M | return f; |
196 | 38.3M | } _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE23EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 2.22M | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 2.22M | auto f = Field(T); | 194 | 2.22M | f.template create_concrete<T>(data); | 195 | 2.22M | return f; | 196 | 2.22M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE37EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 24.2k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 24.2k | auto f = Field(T); | 194 | 24.2k | f.template create_concrete<T>(data); | 195 | 24.2k | return f; | 196 | 24.2k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE41EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 46 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 46 | auto f = Field(T); | 194 | 46 | f.template create_concrete<T>(data); | 195 | 46 | return f; | 196 | 46 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE5EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 28.6M | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 28.6M | auto f = Field(T); | 194 | 28.6M | f.template create_concrete<T>(data); | 195 | 28.6M | return f; | 196 | 28.6M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE2EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 159k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 159k | auto f = Field(T); | 194 | 159k | f.template create_concrete<T>(data); | 195 | 159k | return f; | 196 | 159k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE3EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 499k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 499k | auto f = Field(T); | 194 | 499k | f.template create_concrete<T>(data); | 195 | 499k | return f; | 196 | 499k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE4EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 68.9k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 68.9k | auto f = Field(T); | 194 | 68.9k | f.template create_concrete<T>(data); | 195 | 68.9k | return f; | 196 | 68.9k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE6EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 4.57M | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 4.57M | auto f = Field(T); | 194 | 4.57M | f.template create_concrete<T>(data); | 195 | 4.57M | return f; | 196 | 4.57M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE7EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 41.1k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 41.1k | auto f = Field(T); | 194 | 41.1k | f.template create_concrete<T>(data); | 195 | 41.1k | return f; | 196 | 41.1k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE8EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 47.4k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 47.4k | auto f = Field(T); | 194 | 47.4k | f.template create_concrete<T>(data); | 195 | 47.4k | return f; | 196 | 47.4k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE9EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 226k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 226k | auto f = Field(T); | 194 | 226k | f.template create_concrete<T>(data); | 195 | 226k | return f; | 196 | 226k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE36EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 33.3k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 33.3k | auto f = Field(T); | 194 | 33.3k | f.template create_concrete<T>(data); | 195 | 33.3k | return f; | 196 | 33.3k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE11EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 22.5k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 22.5k | auto f = Field(T); | 194 | 22.5k | f.template create_concrete<T>(data); | 195 | 22.5k | return f; | 196 | 22.5k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE25EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 626k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 626k | auto f = Field(T); | 194 | 626k | f.template create_concrete<T>(data); | 195 | 626k | return f; | 196 | 626k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE12EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 13.9k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 13.9k | auto f = Field(T); | 194 | 13.9k | f.template create_concrete<T>(data); | 195 | 13.9k | return f; | 196 | 13.9k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE26EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 125k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 125k | auto f = Field(T); | 194 | 125k | f.template create_concrete<T>(data); | 195 | 125k | return f; | 196 | 125k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE43EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 384 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 384 | auto f = Field(T); | 194 | 384 | f.template create_concrete<T>(data); | 195 | 384 | return f; | 196 | 384 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE27EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 113 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 113 | auto f = Field(T); | 194 | 113 | f.template create_concrete<T>(data); | 195 | 113 | return f; | 196 | 113 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE42EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 16.0k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 16.0k | auto f = Field(T); | 194 | 16.0k | f.template create_concrete<T>(data); | 195 | 16.0k | return f; | 196 | 16.0k | } |
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 | 192 | 25.7k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 25.7k | auto f = Field(T); | 194 | 25.7k | f.template create_concrete<T>(data); | 195 | 25.7k | return f; | 196 | 25.7k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE29EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 61.6k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 61.6k | auto f = Field(T); | 194 | 61.6k | f.template create_concrete<T>(data); | 195 | 61.6k | return f; | 196 | 61.6k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE20EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 8.85k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 8.85k | auto f = Field(T); | 194 | 8.85k | f.template create_concrete<T>(data); | 195 | 8.85k | return f; | 196 | 8.85k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE30EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 38.9k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 38.9k | auto f = Field(T); | 194 | 38.9k | f.template create_concrete<T>(data); | 195 | 38.9k | return f; | 196 | 38.9k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE35EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 38.5k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 38.5k | auto f = Field(T); | 194 | 38.5k | f.template create_concrete<T>(data); | 195 | 38.5k | return f; | 196 | 38.5k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE17EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 121k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 121k | auto f = Field(T); | 194 | 121k | f.template create_concrete<T>(data); | 195 | 121k | return f; | 196 | 121k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE24EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 22.3k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 22.3k | auto f = Field(T); | 194 | 22.3k | f.template create_concrete<T>(data); | 195 | 22.3k | return f; | 196 | 22.3k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE22EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 2.42k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 2.42k | auto f = Field(T); | 194 | 2.42k | f.template create_concrete<T>(data); | 195 | 2.42k | return f; | 196 | 2.42k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE19EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 404 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 404 | auto f = Field(T); | 194 | 404 | f.template create_concrete<T>(data); | 195 | 404 | return f; | 196 | 404 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE15EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 1.33k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 1.33k | auto f = Field(T); | 194 | 1.33k | f.template create_concrete<T>(data); | 195 | 1.33k | return f; | 196 | 1.33k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE10EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 652k | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 652k | auto f = Field(T); | 194 | 652k | f.template create_concrete<T>(data); | 195 | 652k | return f; | 196 | 652k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE31EEES0_RKNS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 192 | 4 | static Field create_field(const typename PrimitiveTypeTraits<T>::CppType& data) { | 193 | 4 | auto f = Field(T); | 194 | 4 | f.template create_concrete<T>(data); | 195 | 4 | return f; | 196 | 4 | } |
|
197 | | template <PrimitiveType T> |
198 | 99.6M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { |
199 | 99.6M | auto f = Field(T); |
200 | 99.6M | f.template create_concrete<T>(std::move(data)); |
201 | 99.6M | return f; |
202 | 99.6M | } _ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE23EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 14.9M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 14.9M | auto f = Field(T); | 200 | 14.9M | f.template create_concrete<T>(std::move(data)); | 201 | 14.9M | return f; | 202 | 14.9M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE28EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 43.8k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 43.8k | auto f = Field(T); | 200 | 43.8k | f.template create_concrete<T>(std::move(data)); | 201 | 43.8k | return f; | 202 | 43.8k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE29EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 13.5M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 13.5M | auto f = Field(T); | 200 | 13.5M | f.template create_concrete<T>(std::move(data)); | 201 | 13.5M | return f; | 202 | 13.5M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE20EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 11.0k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 11.0k | auto f = Field(T); | 200 | 11.0k | f.template create_concrete<T>(std::move(data)); | 201 | 11.0k | return f; | 202 | 11.0k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE35EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 8.87k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 8.87k | auto f = Field(T); | 200 | 8.87k | f.template create_concrete<T>(std::move(data)); | 201 | 8.87k | return f; | 202 | 8.87k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE30EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 68.9k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 68.9k | auto f = Field(T); | 200 | 68.9k | f.template create_concrete<T>(std::move(data)); | 201 | 68.9k | return f; | 202 | 68.9k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE1EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 54.6k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 54.6k | auto f = Field(T); | 200 | 54.6k | f.template create_concrete<T>(std::move(data)); | 201 | 54.6k | return f; | 202 | 54.6k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE31EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 2.51M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 2.51M | auto f = Field(T); | 200 | 2.51M | f.template create_concrete<T>(std::move(data)); | 201 | 2.51M | return f; | 202 | 2.51M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE2EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 28.6M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 28.6M | auto f = Field(T); | 200 | 28.6M | f.template create_concrete<T>(std::move(data)); | 201 | 28.6M | return f; | 202 | 28.6M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE3EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 7.84M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 7.84M | auto f = Field(T); | 200 | 7.84M | f.template create_concrete<T>(std::move(data)); | 201 | 7.84M | return f; | 202 | 7.84M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE4EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 91.1k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 91.1k | auto f = Field(T); | 200 | 91.1k | f.template create_concrete<T>(std::move(data)); | 201 | 91.1k | return f; | 202 | 91.1k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE5EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 4.41M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 4.41M | auto f = Field(T); | 200 | 4.41M | f.template create_concrete<T>(std::move(data)); | 201 | 4.41M | return f; | 202 | 4.41M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE6EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 20.3M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 20.3M | auto f = Field(T); | 200 | 20.3M | f.template create_concrete<T>(std::move(data)); | 201 | 20.3M | return f; | 202 | 20.3M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE7EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 130k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 130k | auto f = Field(T); | 200 | 130k | f.template create_concrete<T>(std::move(data)); | 201 | 130k | return f; | 202 | 130k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE8EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 49.8k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 49.8k | auto f = Field(T); | 200 | 49.8k | f.template create_concrete<T>(std::move(data)); | 201 | 49.8k | return f; | 202 | 49.8k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE9EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 2.98M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 2.98M | auto f = Field(T); | 200 | 2.98M | f.template create_concrete<T>(std::move(data)); | 201 | 2.98M | return f; | 202 | 2.98M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE11EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 3.80k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 3.80k | auto f = Field(T); | 200 | 3.80k | f.template create_concrete<T>(std::move(data)); | 201 | 3.80k | return f; | 202 | 3.80k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE25EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 210k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 210k | auto f = Field(T); | 200 | 210k | f.template create_concrete<T>(std::move(data)); | 201 | 210k | return f; | 202 | 210k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE12EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 5.38k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 5.38k | auto f = Field(T); | 200 | 5.38k | f.template create_concrete<T>(std::move(data)); | 201 | 5.38k | return f; | 202 | 5.38k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE26EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 253k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 253k | auto f = Field(T); | 200 | 253k | f.template create_concrete<T>(std::move(data)); | 201 | 253k | return f; | 202 | 253k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE43EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 1.18k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 1.18k | auto f = Field(T); | 200 | 1.18k | f.template create_concrete<T>(std::move(data)); | 201 | 1.18k | return f; | 202 | 1.18k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE36EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 4.93k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 4.93k | auto f = Field(T); | 200 | 4.93k | f.template create_concrete<T>(std::move(data)); | 201 | 4.93k | return f; | 202 | 4.93k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE37EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 2.77k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 2.77k | auto f = Field(T); | 200 | 2.77k | f.template create_concrete<T>(std::move(data)); | 201 | 2.77k | return f; | 202 | 2.77k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE27EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 4 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 4 | auto f = Field(T); | 200 | 4 | f.template create_concrete<T>(std::move(data)); | 201 | 4 | return f; | 202 | 4 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE42EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 25.8k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 25.8k | auto f = Field(T); | 200 | 25.8k | f.template create_concrete<T>(std::move(data)); | 201 | 25.8k | return f; | 202 | 25.8k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE17EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 2.19M | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 2.19M | auto f = Field(T); | 200 | 2.19M | f.template create_concrete<T>(std::move(data)); | 201 | 2.19M | return f; | 202 | 2.19M | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE41EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 670 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 670 | auto f = Field(T); | 200 | 670 | f.template create_concrete<T>(std::move(data)); | 201 | 670 | return f; | 202 | 670 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE18EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 24.3k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 24.3k | auto f = Field(T); | 200 | 24.3k | f.template create_concrete<T>(std::move(data)); | 201 | 24.3k | return f; | 202 | 24.3k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE16EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 5.91k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 5.91k | auto f = Field(T); | 200 | 5.91k | f.template create_concrete<T>(std::move(data)); | 201 | 5.91k | return f; | 202 | 5.91k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE22EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 36 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 36 | auto f = Field(T); | 200 | 36 | f.template create_concrete<T>(std::move(data)); | 201 | 36 | return f; | 202 | 36 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE32EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 134k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 134k | auto f = Field(T); | 200 | 134k | f.template create_concrete<T>(std::move(data)); | 201 | 134k | return f; | 202 | 134k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE24EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 10 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 10 | auto f = Field(T); | 200 | 10 | f.template create_concrete<T>(std::move(data)); | 201 | 10 | return f; | 202 | 10 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE19EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 10 | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 10 | auto f = Field(T); | 200 | 10 | f.template create_concrete<T>(std::move(data)); | 201 | 10 | return f; | 202 | 10 | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE15EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 54.9k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 54.9k | auto f = Field(T); | 200 | 54.9k | f.template create_concrete<T>(std::move(data)); | 201 | 54.9k | return f; | 202 | 54.9k | } |
_ZN5doris5Field12create_fieldILNS_13PrimitiveTypeE10EEES0_ONS_19PrimitiveTypeTraitsIXT_EE7CppTypeE Line | Count | Source | 198 | 968k | static Field create_field(typename PrimitiveTypeTraits<T>::CppType&& data) { | 199 | 968k | auto f = Field(T); | 200 | 968k | f.template create_concrete<T>(std::move(data)); | 201 | 968k | return f; | 202 | 968k | } |
|
203 | | |
204 | | template <PrimitiveType PType, typename ValType = std::conditional_t< |
205 | | doris::is_string_type(PType), StringRef, |
206 | | typename PrimitiveTypeTraits<PType>::StorageFieldType>> |
207 | 1.63M | static Field create_field_from_olap_value(const ValType& data) { |
208 | 1.63M | auto f = Field(PType); |
209 | 1.63M | typename PrimitiveTypeTraits<PType>::CppType cpp_value; |
210 | 1.63M | if constexpr (is_string_type(PType)) { |
211 | 559k | cpp_value = String(data.data, data.size); |
212 | 559k | } else if constexpr (is_date_or_datetime(PType)) { |
213 | 1.71k | if constexpr (PType == TYPE_DATE) { |
214 | 711 | cpp_value.from_olap_date(data); |
215 | 1.00k | } else { |
216 | 1.00k | cpp_value.from_olap_datetime(data); |
217 | 1.00k | } |
218 | 1.71k | } else if constexpr (is_decimalv2(PType)) { |
219 | 451 | cpp_value = DecimalV2Value(data.integer, data.fraction); |
220 | 1.06M | } else { |
221 | 1.06M | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); |
222 | 1.06M | } |
223 | 1.63M | f.template create_concrete<PType>(std::move(cpp_value)); |
224 | 1.63M | return f; |
225 | 1.63M | } _ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE3EaEES0_RKT0_ Line | Count | Source | 207 | 119k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 119k | auto f = Field(PType); | 209 | 119k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 119k | } else { | 221 | 119k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 119k | } | 223 | 119k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 119k | return f; | 225 | 119k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE4EsEES0_RKT0_ Line | Count | Source | 207 | 23.7k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 23.7k | auto f = Field(PType); | 209 | 23.7k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 23.7k | } else { | 221 | 23.7k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 23.7k | } | 223 | 23.7k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 23.7k | return f; | 225 | 23.7k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE5EiEES0_RKT0_ Line | Count | Source | 207 | 255k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 255k | auto f = Field(PType); | 209 | 255k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 255k | } else { | 221 | 255k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 255k | } | 223 | 255k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 255k | return f; | 225 | 255k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE6ElEES0_RKT0_ Line | Count | Source | 207 | 382k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 382k | auto f = Field(PType); | 209 | 382k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 382k | } else { | 221 | 382k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 382k | } | 223 | 382k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 382k | return f; | 225 | 382k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE7EnEES0_RKT0_ Line | Count | Source | 207 | 33.9k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 33.9k | auto f = Field(PType); | 209 | 33.9k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 33.9k | } else { | 221 | 33.9k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 33.9k | } | 223 | 33.9k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 33.9k | return f; | 225 | 33.9k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE8EfEES0_RKT0_ Line | Count | Source | 207 | 14.1k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 14.1k | auto f = Field(PType); | 209 | 14.1k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 14.1k | } else { | 221 | 14.1k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 14.1k | } | 223 | 14.1k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 14.1k | return f; | 225 | 14.1k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE9EdEES0_RKT0_ Line | Count | Source | 207 | 20.2k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 20.2k | auto f = Field(PType); | 209 | 20.2k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 20.2k | } else { | 221 | 20.2k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 20.2k | } | 223 | 20.2k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 20.2k | return f; | 225 | 20.2k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE15ENS_9StringRefEEES0_RKT0_ Line | Count | Source | 207 | 35.6k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 35.6k | auto f = Field(PType); | 209 | 35.6k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | 35.6k | if constexpr (is_string_type(PType)) { | 211 | 35.6k | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | | } else { | 221 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | | } | 223 | 35.6k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 35.6k | return f; | 225 | 35.6k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE11ENS_8uint24_tEEES0_RKT0_ Line | Count | Source | 207 | 711 | static Field create_field_from_olap_value(const ValType& data) { | 208 | 711 | auto f = Field(PType); | 209 | 711 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | 711 | } else if constexpr (is_date_or_datetime(PType)) { | 213 | 711 | if constexpr (PType == TYPE_DATE) { | 214 | 711 | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | | } else { | 221 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | | } | 223 | 711 | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 711 | return f; | 225 | 711 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE12EmEES0_RKT0_ Line | Count | Source | 207 | 1.00k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 1.00k | auto f = Field(PType); | 209 | 1.00k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | 1.00k | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | 1.00k | } else { | 216 | 1.00k | cpp_value.from_olap_datetime(data); | 217 | 1.00k | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | | } else { | 221 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | | } | 223 | 1.00k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 1.00k | return f; | 225 | 1.00k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE25EjEES0_RKT0_ Line | Count | Source | 207 | 61.2k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 61.2k | auto f = Field(PType); | 209 | 61.2k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 61.2k | } else { | 221 | 61.2k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 61.2k | } | 223 | 61.2k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 61.2k | return f; | 225 | 61.2k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE26EmEES0_RKT0_ Line | Count | Source | 207 | 69.9k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 69.9k | auto f = Field(PType); | 209 | 69.9k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 69.9k | } else { | 221 | 69.9k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 69.9k | } | 223 | 69.9k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 69.9k | return f; | 225 | 69.9k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE43ElEES0_RKT0_ Line | Count | Source | 207 | 162 | static Field create_field_from_olap_value(const ValType& data) { | 208 | 162 | auto f = Field(PType); | 209 | 162 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 162 | } else { | 221 | 162 | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 162 | } | 223 | 162 | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 162 | return f; | 225 | 162 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE42EmEES0_RKT0_ Line | Count | Source | 207 | 6.94k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 6.94k | auto f = Field(PType); | 209 | 6.94k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 6.94k | } else { | 221 | 6.94k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 6.94k | } | 223 | 6.94k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 6.94k | return f; | 225 | 6.94k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE36EjEES0_RKT0_ Line | Count | Source | 207 | 1.06k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 1.06k | auto f = Field(PType); | 209 | 1.06k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 1.06k | } else { | 221 | 1.06k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 1.06k | } | 223 | 1.06k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 1.06k | return f; | 225 | 1.06k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE37EoEES0_RKT0_ Line | Count | Source | 207 | 1.08k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 1.08k | auto f = Field(PType); | 209 | 1.08k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 1.08k | } else { | 221 | 1.08k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 1.08k | } | 223 | 1.08k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 1.08k | return f; | 225 | 1.08k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE10ENS_9StringRefEEES0_RKT0_ Line | Count | Source | 207 | 356k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 356k | auto f = Field(PType); | 209 | 356k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | 356k | if constexpr (is_string_type(PType)) { | 211 | 356k | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | | } else { | 221 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | | } | 223 | 356k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 356k | return f; | 225 | 356k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE23ENS_9StringRefEEES0_RKT0_ Line | Count | Source | 207 | 167k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 167k | auto f = Field(PType); | 209 | 167k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | 167k | if constexpr (is_string_type(PType)) { | 211 | 167k | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | | } else { | 221 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | | } | 223 | 167k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 167k | return f; | 225 | 167k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE28EiEES0_RKT0_ Line | Count | Source | 207 | 7.11k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 7.11k | auto f = Field(PType); | 209 | 7.11k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 7.11k | } else { | 221 | 7.11k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 7.11k | } | 223 | 7.11k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 7.11k | return f; | 225 | 7.11k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE29ElEES0_RKT0_ Line | Count | Source | 207 | 33.2k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 33.2k | auto f = Field(PType); | 209 | 33.2k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 33.2k | } else { | 221 | 33.2k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 33.2k | } | 223 | 33.2k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 33.2k | return f; | 225 | 33.2k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE30EnEES0_RKT0_ Line | Count | Source | 207 | 20.4k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 20.4k | auto f = Field(PType); | 209 | 20.4k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 20.4k | } else { | 221 | 20.4k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 20.4k | } | 223 | 20.4k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 20.4k | return f; | 225 | 20.4k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE35EN4wide7integerILm256EiEEEES0_RKT0_ Line | Count | Source | 207 | 1.17k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 1.17k | auto f = Field(PType); | 209 | 1.17k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 1.17k | } else { | 221 | 1.17k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 1.17k | } | 223 | 1.17k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 1.17k | return f; | 225 | 1.17k | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE20ENS_11decimal12_tEEES0_RKT0_ Line | Count | Source | 207 | 451 | static Field create_field_from_olap_value(const ValType& data) { | 208 | 451 | auto f = Field(PType); | 209 | 451 | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | 451 | } else if constexpr (is_decimalv2(PType)) { | 219 | 451 | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | | } else { | 221 | | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | | } | 223 | 451 | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 451 | return f; | 225 | 451 | } |
_ZN5doris5Field28create_field_from_olap_valueILNS_13PrimitiveTypeE2EhEES0_RKT0_ Line | Count | Source | 207 | 16.6k | static Field create_field_from_olap_value(const ValType& data) { | 208 | 16.6k | auto f = Field(PType); | 209 | 16.6k | typename PrimitiveTypeTraits<PType>::CppType cpp_value; | 210 | | if constexpr (is_string_type(PType)) { | 211 | | cpp_value = String(data.data, data.size); | 212 | | } else if constexpr (is_date_or_datetime(PType)) { | 213 | | if constexpr (PType == TYPE_DATE) { | 214 | | cpp_value.from_olap_date(data); | 215 | | } else { | 216 | | cpp_value.from_olap_datetime(data); | 217 | | } | 218 | | } else if constexpr (is_decimalv2(PType)) { | 219 | | cpp_value = DecimalV2Value(data.integer, data.fraction); | 220 | 16.6k | } else { | 221 | 16.6k | cpp_value = typename PrimitiveTypeTraits<PType>::CppType(data); | 222 | 16.6k | } | 223 | 16.6k | f.template create_concrete<PType>(std::move(cpp_value)); | 224 | 16.6k | return f; | 225 | 16.6k | } |
|
226 | | |
227 | | /** Despite the presence of a template constructor, this constructor is still needed, |
228 | | * since, in its absence, the compiler will still generate the default constructor. |
229 | | */ |
230 | | Field(const Field& rhs); |
231 | | |
232 | | Field(Field&& rhs); |
233 | | |
234 | | Field& operator=(const Field& rhs); |
235 | | |
236 | 21.1M | bool is_complex_field() const { |
237 | 21.1M | return type == PrimitiveType::TYPE_ARRAY || type == PrimitiveType::TYPE_MAP || |
238 | 21.1M | type == PrimitiveType::TYPE_STRUCT || type == PrimitiveType::TYPE_VARIANT; |
239 | 21.1M | } |
240 | | |
241 | 97.0M | Field& operator=(Field&& rhs) { |
242 | 97.0M | if (this != &rhs) { |
243 | 96.9M | if (type != rhs.type) { |
244 | 61.2M | destroy(); |
245 | 61.2M | create(std::move(rhs)); |
246 | 61.2M | } else { |
247 | 35.7M | assign(std::move(rhs)); |
248 | 35.7M | } |
249 | 96.9M | } |
250 | 97.0M | return *this; |
251 | 97.0M | } |
252 | | |
253 | 580M | ~Field() { destroy(); } |
254 | | |
255 | 186M | PrimitiveType get_type() const { return type; } |
256 | | std::string get_type_name() const; |
257 | | |
258 | 206M | bool is_null() const { return type == PrimitiveType::TYPE_NULL; } |
259 | | |
260 | | // The template parameter T needs to be consistent with `which`. |
261 | | // If not, use NearestFieldType<> externally. |
262 | | // Maybe modify this in the future, reference: https://github.com/ClickHouse/ClickHouse/pull/22003 |
263 | | template <PrimitiveType T> |
264 | | typename PrimitiveTypeTraits<T>::CppType& get(); |
265 | | |
266 | | template <PrimitiveType T> |
267 | | const typename PrimitiveTypeTraits<T>::CppType& get() const; |
268 | | |
269 | 18.7M | bool operator==(const Field& rhs) const { |
270 | 18.7M | return operator<=>(rhs) == std::strong_ordering::equal; |
271 | 18.7M | } |
272 | | |
273 | | std::strong_ordering operator<=>(const Field& rhs) const; |
274 | | |
275 | | std::string_view as_string_view() const; |
276 | | |
277 | | // Return a human-readable representation of the stored value for debugging. |
278 | | // Unlike get_type_name() which returns the type, this prints the actual value. |
279 | | // For decimal types, caller can provide scale for accurate formatting. |
280 | | std::string to_debug_string(int scale) const; |
281 | | |
282 | | private: |
283 | | std::aligned_union_t<DBMS_MIN_FIELD_SIZE - sizeof(PrimitiveType), Null, UInt64, UInt128, Int64, |
284 | | Int128, IPv6, Float64, String, JsonbField, StringView, Array, Struct, Map, |
285 | | VariantField, Decimal32, Decimal64, DecimalV2Value, Decimal128V3, |
286 | | Decimal256, BitmapValue, HyperLogLog, QuantileState> |
287 | | storage; |
288 | | |
289 | | PrimitiveType type; |
290 | | |
291 | | /// Assuming there was no allocated state or it was deallocated (see destroy). |
292 | | template <PrimitiveType Type> |
293 | | void create_concrete(typename PrimitiveTypeTraits<Type>::CppType&& x); |
294 | | template <PrimitiveType Type> |
295 | | void create_concrete(const typename PrimitiveTypeTraits<Type>::CppType& x); |
296 | | /// Assuming same types. |
297 | | template <PrimitiveType Type> |
298 | | void assign_concrete(typename PrimitiveTypeTraits<Type>::CppType&& x); |
299 | | template <PrimitiveType Type> |
300 | | void assign_concrete(const typename PrimitiveTypeTraits<Type>::CppType& x); |
301 | | |
302 | | void create(const Field& field); |
303 | | void create(Field&& field); |
304 | | |
305 | | void assign(const Field& x); |
306 | | void assign(Field&& x); |
307 | | |
308 | | void destroy(); |
309 | | |
310 | | template <PrimitiveType T> |
311 | | void destroy(); |
312 | | }; |
313 | | |
314 | | struct FieldWithDataType { |
315 | | Field field; |
316 | | // used for nested type of array |
317 | | PrimitiveType base_scalar_type_id = PrimitiveType::INVALID_TYPE; |
318 | | uint8_t num_dimensions = 0; |
319 | | int precision = -1; |
320 | | int scale = -1; |
321 | | // True when the array elements are mixed-type and must be converted to the common base |
322 | | // type on insert. Mirrors FieldInfo::need_convert so it survives the FieldWithDataType |
323 | | // round trip in the sparse read path. |
324 | | bool need_convert = false; |
325 | | }; |
326 | | |
327 | | } // namespace doris |
328 | | |
329 | | template <> |
330 | | struct std::hash<doris::Field> { |
331 | 1.69k | size_t operator()(const doris::Field& field) const { |
332 | 1.69k | if (field.is_null()) { |
333 | 151 | return 0; |
334 | 151 | } |
335 | 1.54k | std::hash<std::string_view> hasher; |
336 | 1.54k | return hasher(field.as_string_view()); |
337 | 1.69k | } |
338 | | }; |