yiguolei commented on code in PR #51766: URL: https://github.com/apache/doris/pull/51766#discussion_r2153481243
########## be/src/util/jsonb_utils.cpp: ########## @@ -0,0 +1,97 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "jsonb_utils.h" + +#include <cstdint> + +#include "common/status.h" +#include "util/date_func.h" +#include "util/string_parser.hpp" +#include "vec/runtime/vdatetime_value.h" + +namespace doris { +template <JsonbDecimalType T> +void JsonbToJson::decimal_to_json(const T& value, const uint32_t precision, const uint32_t scale) { + auto value_str = value.to_string(precision, scale); + if (config::enable_json_decimal_as_string) { Review Comment: 不要加这种config,没什么意义。 jsonb ---> json string, 对于decimal 我们的预定义行为就是转成number,或者说float。 如果用户认为应该是string,那么应该用户自己去处理一下jsonb 里的decimal,提前转成string。我们不要把一些用户能自己做的事情,或者可选的事情,变成我们这里的开关。 -- 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]
