Coverage Report

Created: 2026-04-15 18:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/util/io_helper.h
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
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
640
inline std::string int128_to_string(int128_t value) {
43
640
    return fmt::format(FMT_COMPILE("{}"), value);
44
640
}
45
46
0
inline std::string int128_to_string(uint128_t value) {
47
0
    return fmt::format(FMT_COMPILE("{}"), value);
48
0
}
49
50
0
inline std::string int128_to_string(UInt128 value) {
51
0
    return value.to_hex_string();
52
0
}
53
54
template <typename T>
55
void write_text(Decimal<T> value, UInt32 scale, std::ostream& ostr) {
56
    if (value < Decimal<T>(0)) {
57
        value *= Decimal<T>(-1);
58
        if (value > Decimal<T>(0)) {
59
            ostr << '-';
60
        }
61
    }
62
63
    T whole_part = value;
64
65
    if (scale) {
66
        whole_part = value / decimal_scale_multiplier<T>(scale);
67
    }
68
    if constexpr (std::is_same_v<T, __int128_t>) {
69
        ostr << int128_to_string(whole_part);
70
    } else {
71
        ostr << whole_part;
72
    }
73
    if (scale) {
74
        ostr << '.';
75
        String str_fractional(scale, '0');
76
        Int32 pos = scale - 1;
77
        if (value < Decimal<T>(0) && pos >= 0) {
78
            // Reach here iff this value is a min value of a signed numeric type. It means min<int>()
79
            // which is -2147483648 multiply -1 is still -2147483648.
80
            str_fractional[pos] += (value / 10 * 10) - value;
81
            pos--;
82
            value /= 10;
83
            value *= Decimal<T>(-1);
84
        }
85
        for (; pos >= 0; --pos, value /= 10) {
86
            str_fractional[pos] += value % 10;
87
        }
88
        ostr.write(str_fractional.data(), scale);
89
    }
90
}
91
92
template <typename T>
93
242k
bool try_read_float_text(T& x, const StringRef& in) {
94
242k
    static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
95
242k
                  "Argument for readFloatTextImpl must be float or double");
96
242k
    static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.',
97
242k
                  "Layout of char is not like ASCII"); //-V590
98
99
242k
    StringParser::ParseResult result;
100
242k
    x = StringParser::string_to_float<T>(in.data, in.size, &result);
101
102
242k
    return result == StringParser::PARSE_SUCCESS;
103
242k
}
_ZN5doris19try_read_float_textIfEEbRT_RKNS_9StringRefE
Line
Count
Source
93
114k
bool try_read_float_text(T& x, const StringRef& in) {
94
114k
    static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
95
114k
                  "Argument for readFloatTextImpl must be float or double");
96
114k
    static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.',
97
114k
                  "Layout of char is not like ASCII"); //-V590
98
99
114k
    StringParser::ParseResult result;
100
114k
    x = StringParser::string_to_float<T>(in.data, in.size, &result);
101
102
114k
    return result == StringParser::PARSE_SUCCESS;
103
114k
}
_ZN5doris19try_read_float_textIdEEbRT_RKNS_9StringRefE
Line
Count
Source
93
128k
bool try_read_float_text(T& x, const StringRef& in) {
94
128k
    static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
95
128k
                  "Argument for readFloatTextImpl must be float or double");
96
128k
    static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.',
97
128k
                  "Layout of char is not like ASCII"); //-V590
98
99
128k
    StringParser::ParseResult result;
100
128k
    x = StringParser::string_to_float<T>(in.data, in.size, &result);
101
102
128k
    return result == StringParser::PARSE_SUCCESS;
103
128k
}
104
105
template <typename T, bool enable_strict_mode = false>
106
728k
bool try_read_int_text(T& x, const StringRef& buf) {
107
728k
    StringParser::ParseResult result;
108
728k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
728k
    return result == StringParser::PARSE_SUCCESS;
111
728k
}
_ZN5doris17try_read_int_textInLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
90.6k
bool try_read_int_text(T& x, const StringRef& buf) {
107
90.6k
    StringParser::ParseResult result;
108
90.6k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
90.6k
    return result == StringParser::PARSE_SUCCESS;
111
90.6k
}
_ZN5doris17try_read_int_textIaLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
138k
bool try_read_int_text(T& x, const StringRef& buf) {
107
138k
    StringParser::ParseResult result;
108
138k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
138k
    return result == StringParser::PARSE_SUCCESS;
111
138k
}
_ZN5doris17try_read_int_textIaLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
2.00k
bool try_read_int_text(T& x, const StringRef& buf) {
107
2.00k
    StringParser::ParseResult result;
108
2.00k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
2.00k
    return result == StringParser::PARSE_SUCCESS;
111
2.00k
}
_ZN5doris17try_read_int_textIsLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
131k
bool try_read_int_text(T& x, const StringRef& buf) {
107
131k
    StringParser::ParseResult result;
108
131k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
131k
    return result == StringParser::PARSE_SUCCESS;
111
131k
}
_ZN5doris17try_read_int_textIsLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
1.96k
bool try_read_int_text(T& x, const StringRef& buf) {
107
1.96k
    StringParser::ParseResult result;
108
1.96k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
1.96k
    return result == StringParser::PARSE_SUCCESS;
111
1.96k
}
_ZN5doris17try_read_int_textIiLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
197k
bool try_read_int_text(T& x, const StringRef& buf) {
107
197k
    StringParser::ParseResult result;
108
197k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
197k
    return result == StringParser::PARSE_SUCCESS;
111
197k
}
_ZN5doris17try_read_int_textIiLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
1.93k
bool try_read_int_text(T& x, const StringRef& buf) {
107
1.93k
    StringParser::ParseResult result;
108
1.93k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
1.93k
    return result == StringParser::PARSE_SUCCESS;
111
1.93k
}
_ZN5doris17try_read_int_textIlLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
160k
bool try_read_int_text(T& x, const StringRef& buf) {
107
160k
    StringParser::ParseResult result;
108
160k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
160k
    return result == StringParser::PARSE_SUCCESS;
111
160k
}
_ZN5doris17try_read_int_textIlLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
1.92k
bool try_read_int_text(T& x, const StringRef& buf) {
107
1.92k
    StringParser::ParseResult result;
108
1.92k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
1.92k
    return result == StringParser::PARSE_SUCCESS;
111
1.92k
}
_ZN5doris17try_read_int_textInLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
1.87k
bool try_read_int_text(T& x, const StringRef& buf) {
107
1.87k
    StringParser::ParseResult result;
108
1.87k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
1.87k
    return result == StringParser::PARSE_SUCCESS;
111
1.87k
}
Unexecuted instantiation: _ZN5doris17try_read_int_textIjLb0EEEbRT_RKNS_9StringRefE
_ZN5doris17try_read_int_textImLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
40
bool try_read_int_text(T& x, const StringRef& buf) {
107
40
    StringParser::ParseResult result;
108
40
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
40
    return result == StringParser::PARSE_SUCCESS;
111
40
}
112
113
bool read_date_text_impl(VecDateTimeValue& x, const StringRef& buf);
114
115
bool read_date_text_impl(Int64& x, const StringRef& buf, const cctz::time_zone& local_time_zone);
116
117
template <typename T>
118
165k
bool read_ipv4_text_impl(T& x, const StringRef& buf) {
119
165k
    static_assert(std::is_same_v<IPv4, T>);
120
165k
    bool res = IPv4Value::from_string(x, buf.data, buf.size);
121
165k
    return res;
122
165k
}
123
124
template <typename T>
125
119k
bool read_ipv6_text_impl(T& x, const StringRef& buf) {
126
119k
    static_assert(std::is_same_v<IPv6, T>);
127
119k
    bool res = IPv6Value::from_string(x, buf.data, buf.size);
128
119k
    return res;
129
119k
}
130
131
bool read_datetime_text_impl(VecDateTimeValue& x, const StringRef& buf);
132
133
bool read_datetime_text_impl(Int64& x, const StringRef& buf,
134
                             const cctz::time_zone& local_time_zone);
135
136
bool read_date_v2_text_impl(DateV2Value<DateV2ValueType>& x, const StringRef& buf);
137
138
bool read_date_v2_text_impl(DateV2Value<DateV2ValueType>& x, const StringRef& buf,
139
                            const cctz::time_zone& local_time_zone);
140
141
bool read_datetime_v2_text_impl(DateV2Value<DateTimeV2ValueType>& x, const StringRef& buf,
142
                                UInt32 scale = -1);
143
144
bool read_datetime_v2_text_impl(DateV2Value<DateTimeV2ValueType>& x, const StringRef& buf,
145
                                const cctz::time_zone& local_time_zone, UInt32 scale = -1);
146
147
template <PrimitiveType P, typename T>
148
StringParser::ParseResult read_decimal_text_impl(T& x, const StringRef& buf, UInt32 precision,
149
691k
                                                 UInt32 scale) {
150
691k
    static_assert(IsDecimalNumber<T>);
151
691k
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
152
        // DecimalV3: uses the caller-supplied precision and scale.
153
        // When called from from_olap_string with ignore_scale=true, scale=0 means the
154
        // string is treated as an unscaled integer (e.g. "12345" → internal int 12345).
155
666k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
666k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
666k
                                                     &result);
158
666k
        return result;
159
666k
    } else {
160
        // DecimalV2: IGNORES the caller-supplied precision/scale and hardcodes
161
        // DecimalV2Value::PRECISION (27) and DecimalV2Value::SCALE (9).
162
        // This means from_olap_string's ignore_scale flag has no actual effect on DecimalV2
163
        // parsing today — the string "123.456000000" is always parsed with scale=9.
164
        // Callers should still set ignore_scale=false for DecimalV2 for semantic correctness.
165
24.2k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
166
24.2k
        x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>(
167
24.2k
                buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE,
168
24.2k
                &result));
169
24.2k
        return result;
170
24.2k
    }
171
691k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE28ENS_7DecimalIiEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
149
107k
                                                 UInt32 scale) {
150
107k
    static_assert(IsDecimalNumber<T>);
151
107k
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
152
        // DecimalV3: uses the caller-supplied precision and scale.
153
        // When called from from_olap_string with ignore_scale=true, scale=0 means the
154
        // string is treated as an unscaled integer (e.g. "12345" → internal int 12345).
155
107k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
107k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
107k
                                                     &result);
158
107k
        return result;
159
    } else {
160
        // DecimalV2: IGNORES the caller-supplied precision/scale and hardcodes
161
        // DecimalV2Value::PRECISION (27) and DecimalV2Value::SCALE (9).
162
        // This means from_olap_string's ignore_scale flag has no actual effect on DecimalV2
163
        // parsing today — the string "123.456000000" is always parsed with scale=9.
164
        // Callers should still set ignore_scale=false for DecimalV2 for semantic correctness.
165
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
166
        x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>(
167
                buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE,
168
                &result));
169
        return result;
170
    }
171
107k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE29ENS_7DecimalIlEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
149
168k
                                                 UInt32 scale) {
150
168k
    static_assert(IsDecimalNumber<T>);
151
168k
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
152
        // DecimalV3: uses the caller-supplied precision and scale.
153
        // When called from from_olap_string with ignore_scale=true, scale=0 means the
154
        // string is treated as an unscaled integer (e.g. "12345" → internal int 12345).
155
168k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
168k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
168k
                                                     &result);
158
168k
        return result;
159
    } else {
160
        // DecimalV2: IGNORES the caller-supplied precision/scale and hardcodes
161
        // DecimalV2Value::PRECISION (27) and DecimalV2Value::SCALE (9).
162
        // This means from_olap_string's ignore_scale flag has no actual effect on DecimalV2
163
        // parsing today — the string "123.456000000" is always parsed with scale=9.
164
        // Callers should still set ignore_scale=false for DecimalV2 for semantic correctness.
165
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
166
        x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>(
167
                buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE,
168
                &result));
169
        return result;
170
    }
171
168k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE30ENS_12Decimal128V3EEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
149
161k
                                                 UInt32 scale) {
150
161k
    static_assert(IsDecimalNumber<T>);
151
161k
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
152
        // DecimalV3: uses the caller-supplied precision and scale.
153
        // When called from from_olap_string with ignore_scale=true, scale=0 means the
154
        // string is treated as an unscaled integer (e.g. "12345" → internal int 12345).
155
161k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
161k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
161k
                                                     &result);
158
161k
        return result;
159
    } else {
160
        // DecimalV2: IGNORES the caller-supplied precision/scale and hardcodes
161
        // DecimalV2Value::PRECISION (27) and DecimalV2Value::SCALE (9).
162
        // This means from_olap_string's ignore_scale flag has no actual effect on DecimalV2
163
        // parsing today — the string "123.456000000" is always parsed with scale=9.
164
        // Callers should still set ignore_scale=false for DecimalV2 for semantic correctness.
165
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
166
        x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>(
167
                buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE,
168
                &result));
169
        return result;
170
    }
171
161k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE20ENS_14DecimalV2ValueEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
149
24.2k
                                                 UInt32 scale) {
150
24.2k
    static_assert(IsDecimalNumber<T>);
151
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
152
        // DecimalV3: uses the caller-supplied precision and scale.
153
        // When called from from_olap_string with ignore_scale=true, scale=0 means the
154
        // string is treated as an unscaled integer (e.g. "12345" → internal int 12345).
155
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
                                                     &result);
158
        return result;
159
24.2k
    } else {
160
        // DecimalV2: IGNORES the caller-supplied precision/scale and hardcodes
161
        // DecimalV2Value::PRECISION (27) and DecimalV2Value::SCALE (9).
162
        // This means from_olap_string's ignore_scale flag has no actual effect on DecimalV2
163
        // parsing today — the string "123.456000000" is always parsed with scale=9.
164
        // Callers should still set ignore_scale=false for DecimalV2 for semantic correctness.
165
24.2k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
166
24.2k
        x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>(
167
24.2k
                buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE,
168
24.2k
                &result));
169
24.2k
        return result;
170
24.2k
    }
171
24.2k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE35ENS_7DecimalIN4wide7integerILm256EiEEEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
149
229k
                                                 UInt32 scale) {
150
229k
    static_assert(IsDecimalNumber<T>);
151
229k
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
152
        // DecimalV3: uses the caller-supplied precision and scale.
153
        // When called from from_olap_string with ignore_scale=true, scale=0 means the
154
        // string is treated as an unscaled integer (e.g. "12345" → internal int 12345).
155
229k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
229k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
229k
                                                     &result);
158
229k
        return result;
159
    } else {
160
        // DecimalV2: IGNORES the caller-supplied precision/scale and hardcodes
161
        // DecimalV2Value::PRECISION (27) and DecimalV2Value::SCALE (9).
162
        // This means from_olap_string's ignore_scale flag has no actual effect on DecimalV2
163
        // parsing today — the string "123.456000000" is always parsed with scale=9.
164
        // Callers should still set ignore_scale=false for DecimalV2 for semantic correctness.
165
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
166
        x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>(
167
                buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE,
168
                &result));
169
        return result;
170
    }
171
229k
}
172
173
template <typename T>
174
40
const char* try_read_first_int_text(T& x, const char* pos, const char* end) {
175
40
    const int64_t len = end - pos;
176
40
    int64_t i = 0;
177
80
    while (i < len) {
178
80
        if (pos[i] >= '0' && pos[i] <= '9') {
179
40
            i++;
180
40
        } else {
181
40
            break;
182
40
        }
183
80
    }
184
40
    const char* int_end = pos + i;
185
40
    StringRef in((char*)pos, int_end - pos);
186
40
    const size_t count = in.size;
187
40
    try_read_int_text(x, in);
188
40
    return pos + count;
189
40
}
_ZN5doris23try_read_first_int_textImEEPKcRT_S2_S2_
Line
Count
Source
174
40
const char* try_read_first_int_text(T& x, const char* pos, const char* end) {
175
40
    const int64_t len = end - pos;
176
40
    int64_t i = 0;
177
80
    while (i < len) {
178
80
        if (pos[i] >= '0' && pos[i] <= '9') {
179
40
            i++;
180
40
        } else {
181
40
            break;
182
40
        }
183
80
    }
184
40
    const char* int_end = pos + i;
185
40
    StringRef in((char*)pos, int_end - pos);
186
40
    const size_t count = in.size;
187
40
    try_read_int_text(x, in);
188
40
    return pos + count;
189
40
}
Unexecuted instantiation: _ZN5doris23try_read_first_int_textIjEEPKcRT_S2_S2_
190
191
template <PrimitiveType P, typename T>
192
StringParser::ParseResult try_read_decimal_text(T& x, const StringRef& in, UInt32 precision,
193
221k
                                                UInt32 scale) {
194
221k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
221k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE28ENS_7DecimalIiEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
193
59.5k
                                                UInt32 scale) {
194
59.5k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
59.5k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE29ENS_7DecimalIlEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
193
53.8k
                                                UInt32 scale) {
194
53.8k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
53.8k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE30ENS_12Decimal128V3EEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
193
53.8k
                                                UInt32 scale) {
194
53.8k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
53.8k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE20ENS_14DecimalV2ValueEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
193
28
                                                UInt32 scale) {
194
28
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
28
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE35ENS_7DecimalIN4wide7integerILm256EiEEEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
193
53.7k
                                                UInt32 scale) {
194
53.7k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
53.7k
}
196
197
template <typename T>
198
bool try_read_ipv4_text(T& x, const StringRef& in) {
199
    return read_ipv4_text_impl<T>(x, in);
200
}
201
202
template <typename T>
203
bool try_read_ipv6_text(T& x, const StringRef& in) {
204
    return read_ipv6_text_impl<T>(x, in);
205
}
206
207
template <typename T>
208
bool try_read_datetime_text(T& x, const StringRef& in, const cctz::time_zone& local_time_zone) {
209
    return read_datetime_text_impl<T>(x, in, local_time_zone);
210
}
211
212
template <typename T>
213
bool try_read_date_text(T& x, const StringRef& in, const cctz::time_zone& local_time_zone) {
214
    return read_date_text_impl<T>(x, in, local_time_zone);
215
}
216
217
template <typename T>
218
bool try_read_date_v2_text(T& x, const StringRef& in, const cctz::time_zone& local_time_zone) {
219
    return read_date_v2_text_impl<T>(x, in, local_time_zone);
220
}
221
222
template <typename T>
223
bool try_read_datetime_v2_text(T& x, const StringRef& in, const cctz::time_zone& local_time_zone,
224
                               UInt32 scale) {
225
    return read_datetime_v2_text_impl<T>(x, in, local_time_zone, scale);
226
}
227
228
22.1k
bool inline try_read_bool_text(UInt8& x, const StringRef& buf) {
229
22.1k
    StringParser::ParseResult result;
230
22.1k
    x = StringParser::string_to_bool(buf.data, buf.size, &result);
231
22.1k
    return result == StringParser::PARSE_SUCCESS;
232
22.1k
}
233
234
} // namespace doris