[refactor] Remove decimal v1 related code from code base (#6079)
remove ALL DECIMAL V1 type code , this is a part of #6073
This commit is contained in:
@ -23,9 +23,9 @@
|
||||
#include <string>
|
||||
|
||||
#include "exprs/anyval_util.h"
|
||||
#include "test_util/test_util.h"
|
||||
#include "testutil/function_utils.h"
|
||||
#include "util/logging.h"
|
||||
#include "test_util/test_util.h"
|
||||
|
||||
namespace doris {
|
||||
|
||||
@ -109,27 +109,6 @@ TEST_F(StringFunctionsTest, money_format_double) {
|
||||
delete context;
|
||||
}
|
||||
|
||||
TEST_F(StringFunctionsTest, money_format_decimal) {
|
||||
doris_udf::FunctionContext* context = new doris_udf::FunctionContext();
|
||||
|
||||
DecimalValue dv1(std::string("3333333333.2222222222"));
|
||||
DecimalVal value1;
|
||||
dv1.to_decimal_val(&value1);
|
||||
|
||||
StringVal result = StringFunctions::money_format(context, value1);
|
||||
StringVal expected = AnyValUtil::from_string_temp(context, std::string("3,333,333,333.22"));
|
||||
ASSERT_EQ(expected, result);
|
||||
|
||||
DecimalValue dv2(std::string("-7407407406790123456.71604938271975308642"));
|
||||
DecimalVal value2;
|
||||
dv2.to_decimal_val(&value2);
|
||||
|
||||
result = StringFunctions::money_format(context, value2);
|
||||
expected = AnyValUtil::from_string_temp(context, std::string("-7,407,407,406,790,123,456.72"));
|
||||
ASSERT_EQ(expected, result);
|
||||
delete context;
|
||||
}
|
||||
|
||||
TEST_F(StringFunctionsTest, money_format_decimal_v2) {
|
||||
doris_udf::FunctionContext* context = new doris_udf::FunctionContext();
|
||||
|
||||
@ -291,7 +270,7 @@ TEST_F(StringFunctionsTest, null_or_empty) {
|
||||
|
||||
TEST_F(StringFunctionsTest, substring) {
|
||||
doris_udf::FunctionContext* context = new doris_udf::FunctionContext();
|
||||
|
||||
|
||||
ASSERT_EQ(AnyValUtil::from_string_temp(context, std::string("")),
|
||||
StringFunctions::substring(context, StringVal("hello word"), 0, 5));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user