Coverage Report

Created: 2026-03-11 09:44

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/root/doris/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
#include "common/compile_check_begin.h"
43
320
inline std::string int128_to_string(int128_t value) {
44
320
    return fmt::format(FMT_COMPILE("{}"), value);
45
320
}
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
120k
bool try_read_float_text(T& x, const StringRef& in) {
95
120k
    static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
96
120k
                  "Argument for readFloatTextImpl must be float or double");
97
120k
    static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.',
98
120k
                  "Layout of char is not like ASCII"); //-V590
99
100
120k
    StringParser::ParseResult result;
101
120k
    x = StringParser::string_to_float<T>(in.data, in.size, &result);
102
103
120k
    return result == StringParser::PARSE_SUCCESS;
104
120k
}
_ZN5doris19try_read_float_textIfEEbRT_RKNS_9StringRefE
Line
Count
Source
94
56.9k
bool try_read_float_text(T& x, const StringRef& in) {
95
56.9k
    static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
96
56.9k
                  "Argument for readFloatTextImpl must be float or double");
97
56.9k
    static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.',
98
56.9k
                  "Layout of char is not like ASCII"); //-V590
99
100
56.9k
    StringParser::ParseResult result;
101
56.9k
    x = StringParser::string_to_float<T>(in.data, in.size, &result);
102
103
56.9k
    return result == StringParser::PARSE_SUCCESS;
104
56.9k
}
_ZN5doris19try_read_float_textIdEEbRT_RKNS_9StringRefE
Line
Count
Source
94
63.8k
bool try_read_float_text(T& x, const StringRef& in) {
95
63.8k
    static_assert(std::is_same_v<T, double> || std::is_same_v<T, float>,
96
63.8k
                  "Argument for readFloatTextImpl must be float or double");
97
63.8k
    static_assert('a' > '.' && 'A' > '.' && '\n' < '.' && '\t' < '.' && '\'' < '.' && '"' < '.',
98
63.8k
                  "Layout of char is not like ASCII"); //-V590
99
100
63.8k
    StringParser::ParseResult result;
101
63.8k
    x = StringParser::string_to_float<T>(in.data, in.size, &result);
102
103
63.8k
    return result == StringParser::PARSE_SUCCESS;
104
63.8k
}
105
106
template <typename T, bool enable_strict_mode = false>
107
363k
bool try_read_int_text(T& x, const StringRef& buf) {
108
363k
    StringParser::ParseResult result;
109
363k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
363k
    return result == StringParser::PARSE_SUCCESS;
112
363k
}
_ZN5doris17try_read_int_textInLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
45.2k
bool try_read_int_text(T& x, const StringRef& buf) {
108
45.2k
    StringParser::ParseResult result;
109
45.2k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
45.2k
    return result == StringParser::PARSE_SUCCESS;
112
45.2k
}
_ZN5doris17try_read_int_textIaLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
69.1k
bool try_read_int_text(T& x, const StringRef& buf) {
108
69.1k
    StringParser::ParseResult result;
109
69.1k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
69.1k
    return result == StringParser::PARSE_SUCCESS;
112
69.1k
}
_ZN5doris17try_read_int_textIaLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
1.00k
bool try_read_int_text(T& x, const StringRef& buf) {
108
1.00k
    StringParser::ParseResult result;
109
1.00k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
1.00k
    return result == StringParser::PARSE_SUCCESS;
112
1.00k
}
_ZN5doris17try_read_int_textIsLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
65.8k
bool try_read_int_text(T& x, const StringRef& buf) {
108
65.8k
    StringParser::ParseResult result;
109
65.8k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
65.8k
    return result == StringParser::PARSE_SUCCESS;
112
65.8k
}
_ZN5doris17try_read_int_textIsLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
984
bool try_read_int_text(T& x, const StringRef& buf) {
108
984
    StringParser::ParseResult result;
109
984
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
984
    return result == StringParser::PARSE_SUCCESS;
112
984
}
_ZN5doris17try_read_int_textIiLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
98.4k
bool try_read_int_text(T& x, const StringRef& buf) {
108
98.4k
    StringParser::ParseResult result;
109
98.4k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
98.4k
    return result == StringParser::PARSE_SUCCESS;
112
98.4k
}
_ZN5doris17try_read_int_textIiLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
968
bool try_read_int_text(T& x, const StringRef& buf) {
108
968
    StringParser::ParseResult result;
109
968
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
968
    return result == StringParser::PARSE_SUCCESS;
112
968
}
_ZN5doris17try_read_int_textIlLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
80.3k
bool try_read_int_text(T& x, const StringRef& buf) {
108
80.3k
    StringParser::ParseResult result;
109
80.3k
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
80.3k
    return result == StringParser::PARSE_SUCCESS;
112
80.3k
}
_ZN5doris17try_read_int_textIlLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
961
bool try_read_int_text(T& x, const StringRef& buf) {
108
961
    StringParser::ParseResult result;
109
961
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
961
    return result == StringParser::PARSE_SUCCESS;
112
961
}
_ZN5doris17try_read_int_textInLb1EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
936
bool try_read_int_text(T& x, const StringRef& buf) {
108
936
    StringParser::ParseResult result;
109
936
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
936
    return result == StringParser::PARSE_SUCCESS;
112
936
}
Unexecuted instantiation: _ZN5doris17try_read_int_textIjLb0EEEbRT_RKNS_9StringRefE
_ZN5doris17try_read_int_textImLb0EEEbRT_RKNS_9StringRefE
Line
Count
Source
107
20
bool try_read_int_text(T& x, const StringRef& buf) {
108
20
    StringParser::ParseResult result;
109
20
    x = StringParser::string_to_int<T, enable_strict_mode>(buf.data, buf.size, &result);
110
111
20
    return result == StringParser::PARSE_SUCCESS;
112
20
}
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
345k
                                                 UInt32 scale) {
166
345k
    static_assert(IsDecimalNumber<T>);
167
345k
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
168
333k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
169
333k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
170
333k
                                                     &result);
171
333k
        return result;
172
333k
    } 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
345k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE28ENS_7DecimalIiEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
165
53.9k
                                                 UInt32 scale) {
166
53.9k
    static_assert(IsDecimalNumber<T>);
167
53.9k
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
168
53.9k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
169
53.9k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
170
53.9k
                                                     &result);
171
53.9k
        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
53.9k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE29ENS_7DecimalIlEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
165
84.0k
                                                 UInt32 scale) {
166
84.0k
    static_assert(IsDecimalNumber<T>);
167
84.0k
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
168
84.0k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
169
84.0k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
170
84.0k
                                                     &result);
171
84.0k
        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
84.0k
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE30ENS_12Decimal128V3EEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
165
80.6k
                                                 UInt32 scale) {
166
80.6k
    static_assert(IsDecimalNumber<T>);
167
80.6k
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
168
80.6k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
169
80.6k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
170
80.6k
                                                     &result);
171
80.6k
        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
80.6k
}
_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
}
_ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE35ENS_7DecimalIN4wide7integerILm256EiEEEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
165
114k
                                                 UInt32 scale) {
166
114k
    static_assert(IsDecimalNumber<T>);
167
114k
    if constexpr (!std::is_same_v<DecimalV2Value, T>) {
168
114k
        StringParser::ParseResult result = StringParser::PARSE_SUCCESS;
169
114k
        x.value = StringParser::string_to_decimal<P>(buf.data, (int)buf.size, precision, scale,
170
114k
                                                     &result);
171
114k
        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
114k
}
Unexecuted instantiation: _ZN5doris22read_decimal_text_implILNS_13PrimitiveTypeE20ENS_7DecimalInEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
180
181
template <typename T>
182
20
const char* try_read_first_int_text(T& x, const char* pos, const char* end) {
183
20
    const int64_t len = end - pos;
184
20
    int64_t i = 0;
185
40
    while (i < len) {
186
40
        if (pos[i] >= '0' && pos[i] <= '9') {
187
20
            i++;
188
20
        } else {
189
20
            break;
190
20
        }
191
40
    }
192
20
    const char* int_end = pos + i;
193
20
    StringRef in((char*)pos, int_end - pos);
194
20
    const size_t count = in.size;
195
20
    try_read_int_text(x, in);
196
20
    return pos + count;
197
20
}
_ZN5doris23try_read_first_int_textImEEPKcRT_S2_S2_
Line
Count
Source
182
20
const char* try_read_first_int_text(T& x, const char* pos, const char* end) {
183
20
    const int64_t len = end - pos;
184
20
    int64_t i = 0;
185
40
    while (i < len) {
186
40
        if (pos[i] >= '0' && pos[i] <= '9') {
187
20
            i++;
188
20
        } else {
189
20
            break;
190
20
        }
191
40
    }
192
20
    const char* int_end = pos + i;
193
20
    StringRef in((char*)pos, int_end - pos);
194
20
    const size_t count = in.size;
195
20
    try_read_int_text(x, in);
196
20
    return pos + count;
197
20
}
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
110k
                                                UInt32 scale) {
202
110k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
203
110k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE28ENS_7DecimalIiEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
201
29.7k
                                                UInt32 scale) {
202
29.7k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
203
29.7k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE29ENS_7DecimalIlEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
201
26.9k
                                                UInt32 scale) {
202
26.9k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
203
26.9k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE30ENS_12Decimal128V3EEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
201
26.9k
                                                UInt32 scale) {
202
26.9k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
203
26.9k
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE20ENS_14DecimalV2ValueEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
201
6
                                                UInt32 scale) {
202
6
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
203
6
}
_ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE35ENS_7DecimalIN4wide7integerILm256EiEEEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
Line
Count
Source
201
26.8k
                                                UInt32 scale) {
202
26.8k
    return read_decimal_text_impl<P, T>(x, in, precision, scale);
203
26.8k
}
Unexecuted instantiation: _ZN5doris21try_read_decimal_textILNS_13PrimitiveTypeE20ENS_7DecimalInEEEENS_12StringParser11ParseResultERT0_RKNS_9StringRefEjj
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
11.0k
bool inline try_read_bool_text(UInt8& x, const StringRef& buf) {
237
11.0k
    StringParser::ParseResult result;
238
11.0k
    x = StringParser::string_to_bool(buf.data, buf.size, &result);
239
11.0k
    return result == StringParser::PARSE_SUCCESS;
240
11.0k
}
241
242
#include "common/compile_check_end.h"
243
244
} // namespace doris