Mryange commented on code in PR #54760:
URL: https://github.com/apache/doris/pull/54760#discussion_r2278531507
##########
be/src/vec/data_types/serde/data_type_number_serde.cpp:
##########
@@ -176,10 +177,10 @@ Status
DataTypeNumberSerDe<T>::serialize_one_cell_to_json(const IColumn& column,
if constexpr (T == TYPE_IPV6) {
std::string hex = int128_to_string(data);
bw.write(hex.data(), hex.size());
- } else if constexpr (T == TYPE_FLOAT) {
+ } else if constexpr (T == TYPE_FLOAT || T == TYPE_DOUBLE) {
// fmt::format_to maybe get inaccurate results at float type, so we
use gutil implement.
- char buf[MAX_FLOAT_STR_LENGTH + 2];
- int len = to_buffer(data, MAX_FLOAT_STR_LENGTH + 2, buf);
+ char buf[MAX_DOUBLE_STR_LENGTH + 2];
+ int len = fast_to_buffer(data, buf);
Review Comment:
这里也是,可以直接调用CastToString,这样对外的接口就比较统一了。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]