Coverage Report

Created: 2026-04-14 13:42

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
320
inline std::string int128_to_string(int128_t value) {
43
320
    return fmt::format(FMT_COMPILE("{}"), value);
44
320
}
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
121k
bool try_read_float_text(T& x, const StringRef& in) {
94
121k
    static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
95
121k
                  "Argument for readFloatTextImpl must be float or double");
96
121k
    static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.',
97
121k
                  "Layout of char is not like ASCII"); //-V590
98
99
121k
    StringParser::ParseResult result;
100
121k
    x = StringParser::string_to_float<T>(in.data, in.size, &result);
101
102
121k
    return result == StringParser::PARSE_SUCCESS;
103
121k
}
_ZN5doris19try_read_float_textIfEEbRT_RKNS_9StringRefE
Line
Count
Source
93
57.2k
bool try_read_float_text(T& x, const StringRef& in) {
94
57.2k
    static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
95
57.2k
                  "Argument for readFloatTextImpl must be float or double");
96
57.2k
    static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.',
97
57.2k
                  "Layout of char is not like ASCII"); //-V590
98
99
57.2k
    StringParser::ParseResult result;
100
57.2k
    x = StringParser::string_to_float<T>(in.data, in.size, &result);
101
102
57.2k
    return result == StringParser::PARSE_SUCCESS;
103
57.2k
}
_ZN5doris19try_read_float_textIdEEbRT_RKNS_9StringRefE
Line
Count
Source
93
64.0k
bool try_read_float_text(T& x, const StringRef& in) {
94
64.0k
    static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
95
64.0k
                  "Argument for readFloatTextImpl must be float or double");
96
64.0k
    static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.',
97
64.0k
                  "Layout of char is not like ASCII"); //-V590
98
99
64.0k
    StringParser::ParseResult result;
100
64.0k
    x = StringParser::string_to_float<T>(in.data, in.size, &result);
101
102
64.0k
    return result == StringParser::PARSE_SUCCESS;
103
64.0k
}
104
105
template <typename T, bool enable_strict_mode = false>
106
364k
bool try_read_int_text(T& x, const StringRef& buf) {
107
364k
    StringParser::ParseResult result;
108
364k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
364k
    return result == StringParser::PARSE_SUCCESS;
111
364k
}
_ZN5doris17try_read_int_textInLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
45.3k
bool try_read_int_text(T& x, const StringRef& buf) {
107
45.3k
    StringParser::ParseResult result;
108
45.3k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
45.3k
    return result == StringParser::PARSE_SUCCESS;
111
45.3k
}
_ZN5doris17try_read_int_textIaLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
69.1k
bool try_read_int_text(T& x, const StringRef& buf) {
107
69.1k
    StringParser::ParseResult result;
108
69.1k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
69.1k
    return result == StringParser::PARSE_SUCCESS;
111
69.1k
}
_ZN5doris17try_read_int_textIaLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
1.00k
bool try_read_int_text(T& x, const StringRef& buf) {
107
1.00k
    StringParser::ParseResult result;
108
1.00k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
1.00k
    return result == StringParser::PARSE_SUCCESS;
111
1.00k
}
_ZN5doris17try_read_int_textIsLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
65.8k
bool try_read_int_text(T& x, const StringRef& buf) {
107
65.8k
    StringParser::ParseResult result;
108
65.8k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
65.8k
    return result == StringParser::PARSE_SUCCESS;
111
65.8k
}
_ZN5doris17try_read_int_textIsLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
984
bool try_read_int_text(T& x, const StringRef& buf) {
107
984
    StringParser::ParseResult result;
108
984
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
984
    return result == StringParser::PARSE_SUCCESS;
111
984
}
_ZN5doris17try_read_int_textIiLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
98.5k
bool try_read_int_text(T& x, const StringRef& buf) {
107
98.5k
    StringParser::ParseResult result;
108
98.5k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
98.5k
    return result == StringParser::PARSE_SUCCESS;
111
98.5k
}
_ZN5doris17try_read_int_textIiLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
968
bool try_read_int_text(T& x, const StringRef& buf) {
107
968
    StringParser::ParseResult result;
108
968
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
968
    return result == StringParser::PARSE_SUCCESS;
111
968
}
_ZN5doris17try_read_int_textIlLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
80.3k
bool try_read_int_text(T& x, const StringRef& buf) {
107
80.3k
    StringParser::ParseResult result;
108
80.3k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
80.3k
    return result == StringParser::PARSE_SUCCESS;
111
80.3k
}
_ZN5doris17try_read_int_textIlLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
961
bool try_read_int_text(T& x, const StringRef& buf) {
107
961
    StringParser::ParseResult result;
108
961
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
961
    return result == StringParser::PARSE_SUCCESS;
111
961
}
_ZN5doris17try_read_int_textInLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
936
bool try_read_int_text(T& x, const StringRef& buf) {
107
936
    StringParser::ParseResult result;
108
936
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
936
    return result == StringParser::PARSE_SUCCESS;
111
936
}
Unexecuted instantiation: _ZN5doris17try_read_int_textIjLb0EEEbRT_RKNS_9StringRefE
_ZN5doris17try_read_int_textImLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
106
20
bool try_read_int_text(T& x, const StringRef& buf) {
107
20
    StringParser::ParseResult result;
108
20
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
109
110
20
    return result == StringParser::PARSE_SUCCESS;
111
20
}
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
82.9k
bool read_ipv4_text_impl(T& x, const StringRef& buf) {
119
82.9k
    static_assert(std::is_same_v<IPv4, T>);
120
82.9k
    bool res = IPv4Value::from_string(x, buf.data, buf.size);
121
82.9k
    return res;
122
82.9k
}
123
124
template <typename T>
125
59.7k
bool read_ipv6_text_impl(T& x, const StringRef& buf) {
126
59.7k
    static_assert(std::is_same_v<IPv6, T>);
127
59.7k
    bool res = IPv6Value::from_string(x, buf.data, buf.size);
128
59.7k
    return res;
129
59.7k
}
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
345k
                                                 UInt32 scale) {
150
345k
    static_assert(IsDecimalNumber<T>);
151
345k
    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
333k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
333k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
333k
                                                     &result);
158
333k
        return result;
159
333k
    } 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
12.1k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
166
12.1k
        x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>(
167
12.1k
                buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE,
168
12.1k
                &result));
169
12.1k
        return result;
170
12.1k
    }
171
345k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE28ENS_7DecimalIiEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
149
53.9k
                                                 UInt32 scale) {
150
53.9k
    static_assert(IsDecimalNumber<T>);
151
53.9k
    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
53.9k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
53.9k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
53.9k
                                                     &result);
158
53.9k
        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
53.9k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE29ENS_7DecimalIlEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
149
84.0k
                                                 UInt32 scale) {
150
84.0k
    static_assert(IsDecimalNumber<T>);
151
84.0k
    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
84.0k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
84.0k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
84.0k
                                                     &result);
158
84.0k
        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
84.0k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE30ENS_12Decimal128V3EEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
149
80.6k
                                                 UInt32 scale) {
150
80.6k
    static_assert(IsDecimalNumber<T>);
151
80.6k
    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
80.6k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
80.6k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
80.6k
                                                     &result);
158
80.6k
        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
80.6k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE20ENS_14DecimalV2ValueEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
149
12.1k
                                                 UInt32 scale) {
150
12.1k
    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
12.1k
    } 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
12.1k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
166
12.1k
        x = DecimalV2Value(StringParser::string_to_decimal<TYPE_DECIMALV2>(
167
12.1k
                buf.data, (int)buf.size, DecimalV2Value::PRECISION, DecimalV2Value::SCALE,
168
12.1k
                &result));
169
12.1k
        return result;
170
12.1k
    }
171
12.1k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE35ENS_7DecimalIN4wide7integerILm256EiEEEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
149
114k
                                                 UInt32 scale) {
150
114k
    static_assert(IsDecimalNumber<T>);
151
114k
    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
114k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
156
114k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
157
114k
                                                     &result);
158
114k
        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
114k
}
172
173
template <typename T>
174
20
const char* try_read_first_int_text(T& x, const char* pos, const char* end) {
175
20
    const int64_t len = end - pos;
176
20
    int64_t i = 0;
177
40
    while (i < len) {
178
40
        if (pos[i] >= '0' && pos[i] <= '9') {
179
20
            i++;
180
20
        } else {
181
20
            break;
182
20
        }
183
40
    }
184
20
    const char* int_end = pos + i;
185
20
    StringRef in((char*)pos, int_end - pos);
186
20
    const size_t count = in.size;
187
20
    try_read_int_text(x, in);
188
20
    return pos + count;
189
20
}
_ZN5doris23try_read_first_int_textImEEPKcRT_S2_S2_
Line
Count
Source
174
20
const char* try_read_first_int_text(T& x, const char* pos, const char* end) {
175
20
    const int64_t len = end - pos;
176
20
    int64_t i = 0;
177
40
    while (i < len) {
178
40
        if (pos[i] >= '0' && pos[i] <= '9') {
179
20
            i++;
180
20
        } else {
181
20
            break;
182
20
        }
183
40
    }
184
20
    const char* int_end = pos + i;
185
20
    StringRef in((char*)pos, int_end - pos);
186
20
    const size_t count = in.size;
187
20
    try_read_int_text(x, in);
188
20
    return pos + count;
189
20
}
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
110k
                                                UInt32 scale) {
194
110k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
110k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE28ENS_7DecimalIiEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
193
29.7k
                                                UInt32 scale) {
194
29.7k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
29.7k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE29ENS_7DecimalIlEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
193
26.9k
                                                UInt32 scale) {
194
26.9k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
26.9k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE30ENS_12Decimal128V3EEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
193
26.9k
                                                UInt32 scale) {
194
26.9k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
26.9k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE20ENS_14DecimalV2ValueEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
193
14
                                                UInt32 scale) {
194
14
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
14
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE35ENS_7DecimalIN4wide7integerILm256EiEEEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
193
26.8k
                                                UInt32 scale) {
194
26.8k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
195
26.8k
}
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
11.0k
bool inline try_read_bool_text(UInt8& x, const StringRef& buf) {
229
11.0k
    StringParser::ParseResult result;
230
11.0k
    x = StringParser::string_to_bool(buf.data, buf.size, &result);
231
11.0k
    return result == StringParser::PARSE_SUCCESS;
232
11.0k
}
233
234
} // namespace doris