Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #pragma once |
19 | | |
20 | | #include <fmt/compile.h> |
21 | | #include <gen_cpp/data.pb.h> |
22 | | #include <snappy/snappy.h> |
23 | | |
24 | | #include <iostream> |
25 | | #include <type_traits> |
26 | | |
27 | | #include "common/exception.h" |
28 | | #include "core/arena.h" |
29 | | #include "core/binary_cast.hpp" |
30 | | #include "core/field.h" |
31 | | #include "core/string_buffer.hpp" |
32 | | #include "core/string_ref.h" |
33 | | #include "core/types.h" |
34 | | #include "core/uint128.h" |
35 | | #include "core/value/ipv4_value.h" |
36 | | #include "core/value/ipv6_value.h" |
37 | | #include "core/value/vdatetime_value.h" |
38 | | #include "util/string_parser.hpp" |
39 | | #include "util/var_int.h" |
40 | | |
41 | | namespace doris { |
42 | | #include "common/compile_check_begin.h" |
43 | 9.31k | inline std::string int128_to_string(int128_t value) { |
44 | 9.31k | return fmt::format(FMT_COMPILE("{}"), value); |
45 | 9.31k | } |
46 | | |
47 | 0 | inline std::string int128_to_string(uint128_t value) { |
48 | 0 | return fmt::format(FMT_COMPILE("{}"), value); |
49 | 0 | } |
50 | | |
51 | 0 | inline std::string int128_to_string(UInt128 value) { |
52 | 0 | return value.to_hex_string(); |
53 | 0 | } |
54 | | |
55 | | template <typename T> |
56 | | void write_text(Decimal<T> value, UInt32 scale, std::ostream& ostr) { |
57 | | if (value < Decimal<T>(0)) { |
58 | | value *= Decimal<T>(-1); |
59 | | if (value > Decimal<T>(0)) { |
60 | | ostr << '-'; |
61 | | } |
62 | | } |
63 | | |
64 | | T whole_part = value; |
65 | | |
66 | | if (scale) { |
67 | | whole_part = value / decimal_scale_multiplier<T>(scale); |
68 | | } |
69 | | if constexpr (std::is_same_v<T, __int128_t>) { |
70 | | ostr << int128_to_string(whole_part); |
71 | | } else { |
72 | | ostr << whole_part; |
73 | | } |
74 | | if (scale) { |
75 | | ostr << '.'; |
76 | | String str_fractional(scale, '0'); |
77 | | Int32 pos = scale - 1; |
78 | | if (value < Decimal<T>(0) && pos >= 0) { |
79 | | // Reach here iff this value is a min value of a signed numeric type. It means min<int>() |
80 | | // which is -2147483648 multiply -1 is still -2147483648. |
81 | | str_fractional[pos] += (value / 10 * 10) - value; |
82 | | pos--; |
83 | | value /= 10; |
84 | | value *= Decimal<T>(-1); |
85 | | } |
86 | | for (; pos >= 0; --pos, value /= 10) { |
87 | | str_fractional[pos] += value % 10; |
88 | | } |
89 | | ostr.write(str_fractional.data(), scale); |
90 | | } |
91 | | } |
92 | | |
93 | | template <typename T> |
94 | 5.68M | bool try_read_float_text(T& x, const StringRef& in) { |
95 | 5.68M | static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>, |
96 | 5.68M | "Argument for readFloatTextImpl must be float or double"); |
97 | 5.68M | static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.', |
98 | 5.68M | "Layout of char is not like ASCII"); //-V590 |
99 | | |
100 | 5.68M | StringParser::ParseResult result; |
101 | 5.68M | x = StringParser::string_to_float<T>(in.data, in.size, &result); |
102 | | |
103 | 5.68M | return result == StringParser::PARSE_SUCCESS; |
104 | 5.68M | } _ZN5doris19try_read_float_textIfEEbRT_RKNS_9StringRefE Line | Count | Source | 94 | 1.56M | bool try_read_float_text(T& x, const StringRef& in) { | 95 | 1.56M | static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>, | 96 | 1.56M | "Argument for readFloatTextImpl must be float or double"); | 97 | 1.56M | static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.', | 98 | 1.56M | "Layout of char is not like ASCII"); //-V590 | 99 | | | 100 | 1.56M | StringParser::ParseResult result; | 101 | 1.56M | x = StringParser::string_to_float<T>(in.data, in.size, &result); | 102 | | | 103 | 1.56M | return result == StringParser::PARSE_SUCCESS; | 104 | 1.56M | } |
_ZN5doris19try_read_float_textIdEEbRT_RKNS_9StringRefE Line | Count | Source | 94 | 4.12M | bool try_read_float_text(T& x, const StringRef& in) { | 95 | 4.12M | static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>, | 96 | 4.12M | "Argument for readFloatTextImpl must be float or double"); | 97 | 4.12M | static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.', | 98 | 4.12M | "Layout of char is not like ASCII"); //-V590 | 99 | | | 100 | 4.12M | StringParser::ParseResult result; | 101 | 4.12M | x = StringParser::string_to_float<T>(in.data, in.size, &result); | 102 | | | 103 | 4.12M | return result == StringParser::PARSE_SUCCESS; | 104 | 4.12M | } |
|
105 | | |
106 | | template <typename T, bool enable_strict_mode = false> |
107 | 137M | bool try_read_int_text(T& x, const StringRef& buf) { |
108 | 137M | StringParser::ParseResult result; |
109 | 137M | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); |
110 | | |
111 | 137M | return result == StringParser::PARSE_SUCCESS; |
112 | 137M | } _ZN5doris17try_read_int_textInLb0EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 1.03M | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 1.03M | StringParser::ParseResult result; | 109 | 1.03M | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 1.03M | return result == StringParser::PARSE_SUCCESS; | 112 | 1.03M | } |
_ZN5doris17try_read_int_textIaLb0EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 8.88M | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 8.88M | StringParser::ParseResult result; | 109 | 8.88M | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 8.88M | return result == StringParser::PARSE_SUCCESS; | 112 | 8.88M | } |
_ZN5doris17try_read_int_textIsLb0EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 1.17M | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 1.17M | StringParser::ParseResult result; | 109 | 1.17M | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 1.17M | return result == StringParser::PARSE_SUCCESS; | 112 | 1.17M | } |
_ZN5doris17try_read_int_textIiLb0EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 55.8M | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 55.8M | StringParser::ParseResult result; | 109 | 55.8M | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 55.8M | return result == StringParser::PARSE_SUCCESS; | 112 | 55.8M | } |
_ZN5doris17try_read_int_textIlLb0EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 70.4M | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 70.4M | StringParser::ParseResult result; | 109 | 70.4M | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 70.4M | return result == StringParser::PARSE_SUCCESS; | 112 | 70.4M | } |
_ZN5doris17try_read_int_textIaLb1EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 11.9k | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 11.9k | StringParser::ParseResult result; | 109 | 11.9k | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 11.9k | return result == StringParser::PARSE_SUCCESS; | 112 | 11.9k | } |
_ZN5doris17try_read_int_textIsLb1EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 11.9k | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 11.9k | StringParser::ParseResult result; | 109 | 11.9k | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 11.9k | return result == StringParser::PARSE_SUCCESS; | 112 | 11.9k | } |
_ZN5doris17try_read_int_textIiLb1EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 13.7k | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 13.7k | StringParser::ParseResult result; | 109 | 13.7k | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 13.7k | return result == StringParser::PARSE_SUCCESS; | 112 | 13.7k | } |
_ZN5doris17try_read_int_textIlLb1EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 14.4k | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 14.4k | StringParser::ParseResult result; | 109 | 14.4k | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 14.4k | return result == StringParser::PARSE_SUCCESS; | 112 | 14.4k | } |
_ZN5doris17try_read_int_textInLb1EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 11.6k | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 11.6k | StringParser::ParseResult result; | 109 | 11.6k | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 11.6k | return result == StringParser::PARSE_SUCCESS; | 112 | 11.6k | } |
Unexecuted instantiation: _ZN5doris17try_read_int_textIjLb0EEEbRT_RKNS_9StringRefE _ZN5doris17try_read_int_textImLb0EEEbRT_RKNS_9StringRefE Line | Count | Source | 107 | 3.91k | bool try_read_int_text(T& x, const StringRef& buf) { | 108 | 3.91k | StringParser::ParseResult result; | 109 | 3.91k | x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result); | 110 | | | 111 | 3.91k | return result == StringParser::PARSE_SUCCESS; | 112 | 3.91k | } |
|
113 | | |
114 | | bool read_date_text_impl(VecDateTimeValue& x, const StringRef& buf); |
115 | | |
116 | | template <typename T> |
117 | | bool read_date_text_impl(T& x, const StringRef& buf, const cctz::time_zone& local_time_zone) { |
118 | | static_assert(std::is_same_v<Int64, T>); |
119 | | auto dv = binary_cast<Int64, VecDateTimeValue>(x); |
120 | | auto ans = dv.from_date_str(buf.data, buf.size, local_time_zone); |
121 | | dv.cast_to_date(); |
122 | | x = binary_cast<VecDateTimeValue, Int64>(dv); |
123 | | return ans; |
124 | | } |
125 | | |
126 | | template <typename T> |
127 | 82.9k | bool read_ipv4_text_impl(T& x, const StringRef& buf) { |
128 | 82.9k | static_assert(std::is_same_v<IPv4, T>); |
129 | 82.9k | bool res = IPv4Value::from_string(x, buf.data, buf.size); |
130 | 82.9k | return res; |
131 | 82.9k | } |
132 | | |
133 | | template <typename T> |
134 | 59.7k | bool read_ipv6_text_impl(T& x, const StringRef& buf) { |
135 | 59.7k | static_assert(std::is_same_v<IPv6, T>); |
136 | 59.7k | bool res = IPv6Value::from_string(x, buf.data, buf.size); |
137 | 59.7k | return res; |
138 | 59.7k | } |
139 | | |
140 | | bool read_datetime_text_impl(VecDateTimeValue& x, const StringRef& buf); |
141 | | |
142 | | template <typename T> |
143 | | bool read_datetime_text_impl(T& x, const StringRef& buf, const cctz::time_zone& local_time_zone) { |
144 | | static_assert(std::is_same_v<Int64, T>); |
145 | | auto dv = binary_cast<Int64, VecDateTimeValue>(x); |
146 | | auto ans = dv.from_date_str(buf.data, buf.size, local_time_zone); |
147 | | dv.to_datetime(); |
148 | | x = binary_cast<VecDateTimeValue, Int64>(dv); |
149 | | return ans; |
150 | | } |
151 | | |
152 | | bool read_date_v2_text_impl(DateV2Value<DateV2ValueType>& x, const StringRef& buf); |
153 | | |
154 | | bool read_date_v2_text_impl(DateV2Value<DateV2ValueType>& x, const StringRef& buf, |
155 | | const cctz::time_zone& local_time_zone); |
156 | | |
157 | | bool read_datetime_v2_text_impl(DateV2Value<DateTimeV2ValueType>& x, const StringRef& buf, |
158 | | UInt32 scale = -1); |
159 | | |
160 | | bool read_datetime_v2_text_impl(DateV2Value<DateTimeV2ValueType>& x, const StringRef& buf, |
161 | | const cctz::time_zone& local_time_zone, UInt32 scale = -1); |
162 | | |
163 | | template <PrimitiveType P, typename T> |
164 | | StringParser::ParseResult read_decimal_text_impl(T& x, const StringRef& buf, UInt32 precision, |
165 | 21.0M | UInt32 scale) { |
166 | 21.0M | static_assert(IsDecimalNumber<T>); |
167 | 21.0M | if constexpr (!std::is_same_v<DecimalV2Value, T>) { |
168 | 21.0M | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; |
169 | 21.0M | x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale, |
170 | 21.0M | &result); |
171 | 21.0M | return result; |
172 | 21.0M | } else { |
173 | 12.1k | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; |
174 | 12.1k | x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>( |
175 | 12.1k | buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE, |
176 | 12.1k | &result)); |
177 | 12.1k | return result; |
178 | 12.1k | } |
179 | 21.0M | } _ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE20ENS_7DecimalInEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 165 | 24 | UInt32 scale) { | 166 | 24 | static_assert(IsDecimalNumber<T>); | 167 | 24 | if constexpr (!std::is_same_v<DecimalV2Value, T>) { | 168 | 24 | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 169 | 24 | x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale, | 170 | 24 | &result); | 171 | 24 | return result; | 172 | | } else { | 173 | | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 174 | | x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>( | 175 | | buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE, | 176 | | &result)); | 177 | | return result; | 178 | | } | 179 | 24 | } |
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE28ENS_7DecimalIiEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 165 | 2.04M | UInt32 scale) { | 166 | 2.04M | static_assert(IsDecimalNumber<T>); | 167 | 2.04M | if constexpr (!std::is_same_v<DecimalV2Value, T>) { | 168 | 2.04M | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 169 | 2.04M | x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale, | 170 | 2.04M | &result); | 171 | 2.04M | return result; | 172 | | } else { | 173 | | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 174 | | x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>( | 175 | | buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE, | 176 | | &result)); | 177 | | return result; | 178 | | } | 179 | 2.04M | } |
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE29ENS_7DecimalIlEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 165 | 16.2M | UInt32 scale) { | 166 | 16.2M | static_assert(IsDecimalNumber<T>); | 167 | 16.2M | if constexpr (!std::is_same_v<DecimalV2Value, T>) { | 168 | 16.2M | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 169 | 16.2M | x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale, | 170 | 16.2M | &result); | 171 | 16.2M | return result; | 172 | | } else { | 173 | | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 174 | | x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>( | 175 | | buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE, | 176 | | &result)); | 177 | | return result; | 178 | | } | 179 | 16.2M | } |
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE30ENS_12Decimal128V3EEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 165 | 2.67M | UInt32 scale) { | 166 | 2.67M | static_assert(IsDecimalNumber<T>); | 167 | 2.67M | if constexpr (!std::is_same_v<DecimalV2Value, T>) { | 168 | 2.67M | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 169 | 2.67M | x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale, | 170 | 2.67M | &result); | 171 | 2.67M | return result; | 172 | | } else { | 173 | | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 174 | | x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>( | 175 | | buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE, | 176 | | &result)); | 177 | | return result; | 178 | | } | 179 | 2.67M | } |
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE35ENS_7DecimalIN4wide7integerILm256EiEEEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 165 | 127k | UInt32 scale) { | 166 | 127k | static_assert(IsDecimalNumber<T>); | 167 | 127k | if constexpr (!std::is_same_v<DecimalV2Value, T>) { | 168 | 127k | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 169 | 127k | x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale, | 170 | 127k | &result); | 171 | 127k | return result; | 172 | | } else { | 173 | | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 174 | | x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>( | 175 | | buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE, | 176 | | &result)); | 177 | | return result; | 178 | | } | 179 | 127k | } |
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE20ENS_14DecimalV2ValueEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 165 | 12.1k | UInt32 scale) { | 166 | 12.1k | static_assert(IsDecimalNumber<T>); | 167 | | if constexpr (!std::is_same_v<DecimalV2Value, T>) { | 168 | | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 169 | | x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale, | 170 | | &result); | 171 | | return result; | 172 | 12.1k | } else { | 173 | 12.1k | StringParser::ParseResult result = StringParser::PARSE_SUCCESS; | 174 | 12.1k | x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>( | 175 | 12.1k | buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE, | 176 | 12.1k | &result)); | 177 | 12.1k | return result; | 178 | 12.1k | } | 179 | 12.1k | } |
|
180 | | |
181 | | template <typename T> |
182 | 3.91k | const char* try_read_first_int_text(T& x, const char* pos, const char* end) { |
183 | 3.91k | const int64_t len = end - pos; |
184 | 3.91k | int64_t i = 0; |
185 | 8.01k | while (i < len) { |
186 | 8.01k | if (pos[i] >= '0' && pos[i] <= '9') { |
187 | 4.10k | i++; |
188 | 4.10k | } else { |
189 | 3.91k | break; |
190 | 3.91k | } |
191 | 8.01k | } |
192 | 3.91k | const char* int_end = pos + i; |
193 | 3.91k | StringRef in((char*)pos, int_end - pos); |
194 | 3.91k | const size_t count = in.size; |
195 | 3.91k | try_read_int_text(x, in); |
196 | 3.91k | return pos + count; |
197 | 3.91k | } _ZN5doris23try_read_first_int_textImEEPKcRT_S2_S2_ Line | Count | Source | 182 | 3.91k | const char* try_read_first_int_text(T& x, const char* pos, const char* end) { | 183 | 3.91k | const int64_t len = end - pos; | 184 | 3.91k | int64_t i = 0; | 185 | 8.01k | while (i < len) { | 186 | 8.01k | if (pos[i] >= '0' && pos[i] <= '9') { | 187 | 4.10k | i++; | 188 | 4.10k | } else { | 189 | 3.91k | break; | 190 | 3.91k | } | 191 | 8.01k | } | 192 | 3.91k | const char* int_end = pos + i; | 193 | 3.91k | StringRef in((char*)pos, int_end - pos); | 194 | 3.91k | const size_t count = in.size; | 195 | 3.91k | try_read_int_text(x, in); | 196 | 3.91k | return pos + count; | 197 | 3.91k | } |
Unexecuted instantiation: _ZN5doris23try_read_first_int_textIjEEPKcRT_S2_S2_ |
198 | | |
199 | | template <PrimitiveType P, typename T> |
200 | | StringParser::ParseResult try_read_decimal_text(T& x, const StringRef& in, UInt32 precision, |
201 | 17.3M | UInt32 scale) { |
202 | 17.3M | return read_decimal_text_impl<P, T>(x, in, precision, scale); |
203 | 17.3M | } _ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE20ENS_7DecimalInEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 201 | 24 | UInt32 scale) { | 202 | 24 | return read_decimal_text_impl<P, T>(x, in, precision, scale); | 203 | 24 | } |
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE28ENS_7DecimalIiEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 201 | 300k | UInt32 scale) { | 202 | 300k | return read_decimal_text_impl<P, T>(x, in, precision, scale); | 203 | 300k | } |
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE29ENS_7DecimalIlEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 201 | 15.0M | UInt32 scale) { | 202 | 15.0M | return read_decimal_text_impl<P, T>(x, in, precision, scale); | 203 | 15.0M | } |
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE30ENS_12Decimal128V3EEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 201 | 2.00M | UInt32 scale) { | 202 | 2.00M | return read_decimal_text_impl<P, T>(x, in, precision, scale); | 203 | 2.00M | } |
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE35ENS_7DecimalIN4wide7integerILm256EiEEEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 201 | 39.8k | UInt32 scale) { | 202 | 39.8k | return read_decimal_text_impl<P, T>(x, in, precision, scale); | 203 | 39.8k | } |
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE20ENS_14DecimalV2ValueEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj Line | Count | Source | 201 | 31 | UInt32 scale) { | 202 | 31 | return read_decimal_text_impl<P, T>(x, in, precision, scale); | 203 | 31 | } |
|
204 | | |
205 | | template <typename T> |
206 | | bool try_read_ipv4_text(T& x, const StringRef& in) { |
207 | | return read_ipv4_text_impl<T>(x, in); |
208 | | } |
209 | | |
210 | | template <typename T> |
211 | | bool try_read_ipv6_text(T& x, const StringRef& in) { |
212 | | return read_ipv6_text_impl<T>(x, in); |
213 | | } |
214 | | |
215 | | template <typename T> |
216 | | bool try_read_datetime_text(T& x, const StringRef& in, const cctz::time_zone& local_time_zone) { |
217 | | return read_datetime_text_impl<T>(x, in, local_time_zone); |
218 | | } |
219 | | |
220 | | template <typename T> |
221 | | bool try_read_date_text(T& x, const StringRef& in, const cctz::time_zone& local_time_zone) { |
222 | | return read_date_text_impl<T>(x, in, local_time_zone); |
223 | | } |
224 | | |
225 | | template <typename T> |
226 | | bool try_read_date_v2_text(T& x, const StringRef& in, const cctz::time_zone& local_time_zone) { |
227 | | return read_date_v2_text_impl<T>(x, in, local_time_zone); |
228 | | } |
229 | | |
230 | | template <typename T> |
231 | | bool try_read_datetime_v2_text(T& x, const StringRef& in, const cctz::time_zone& local_time_zone, |
232 | | UInt32 scale) { |
233 | | return read_datetime_v2_text_impl<T>(x, in, local_time_zone, scale); |
234 | | } |
235 | | |
236 | 1.26M | bool inline try_read_bool_text(UInt8& x, const StringRef& buf) { |
237 | 1.26M | StringParser::ParseResult result; |
238 | 1.26M | x = StringParser::string_to_bool(buf.data, buf.size, &result); |
239 | 1.26M | return result == StringParser::PARSE_SUCCESS; |
240 | 1.26M | } |
241 | | |
242 | | #include "common/compile_check_end.h" |
243 | | |
244 | | } // namespace doris |