Skip to content

Commit ee8f1de

Browse files
committed
math
1 parent 29e48e4 commit ee8f1de

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

be/src/vec/functions/function_unary_arithmetic.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ class FunctionUnaryArithmetic : public IFunction {
9999
DataTypePtr get_return_type_impl(const DataTypes& arguments) const override {
100100
DataTypePtr result;
101101
bool valid = cast_type(arguments[0].get(), [&](const auto& type) {
102-
using DataType = std::decay_t<decltype(type)>;
102+
using DecayedDataType = std::decay_t<decltype(type)>;
103103

104-
if constexpr (IsDataTypeDecimal<DataType>) {
104+
if constexpr (IsDataTypeDecimal<DecayedDataType>) {
105105
if constexpr (!allow_decimal) return false;
106-
result = std::make_shared<DataType>(type.get_precision(), type.get_scale());
106+
result = std::make_shared<DecayedDataType>(type.get_precision(), type.get_scale());
107107
} else {
108108
result = std::make_shared<typename PrimitiveTypeTraits<Op::ResultType>::DataType>();
109109
}
@@ -121,31 +121,31 @@ class FunctionUnaryArithmetic : public IFunction {
121121
uint32_t result, size_t input_rows_count) const override {
122122
bool valid =
123123
cast_type(block.get_by_position(arguments[0]).type.get(), [&](const auto& type) {
124-
using DataType = std::decay_t<decltype(type)>;
124+
using DecayedDataType = std::decay_t<decltype(type)>;
125125

126-
if constexpr (IsDataTypeDecimal<DataType>) {
126+
if constexpr (IsDataTypeDecimal<DecayedDataType>) {
127127
if (allow_decimal) {
128-
if (auto col = check_and_get_column<ColumnDecimal<DataType::PType>>(
128+
if (auto col = check_and_get_column<ColumnDecimal<DecayedDataType::PType>>(
129129
block.get_by_position(arguments[0]).column.get())) {
130130
auto col_res =
131131
PrimitiveTypeTraits<Op::ResultType>::ColumnType::create(
132132
0, type.get_scale());
133133
auto& vec_res = col_res->get_data();
134134
vec_res.resize(col->get_data().size());
135-
UnaryOperationImpl<DataType::PType, Op>::vector(col->get_data(),
135+
UnaryOperationImpl<DecayedDataType::PType, Op>::vector(col->get_data(),
136136
vec_res);
137137
block.replace_by_position(result, std::move(col_res));
138138
return true;
139139
}
140140
}
141141
} else {
142-
if (auto col = check_and_get_column<ColumnVector<DataType::PType>>(
142+
if (auto col = check_and_get_column<ColumnVector<DecayedDataType::PType>>(
143143
block.get_by_position(arguments[0]).column.get())) {
144144
auto col_res =
145145
PrimitiveTypeTraits<Op::ResultType>::ColumnType::create();
146146
auto& vec_res = col_res->get_data();
147147
vec_res.resize(col->get_data().size());
148-
UnaryOperationImpl<DataType::PType, Op>::vector(col->get_data(),
148+
UnaryOperationImpl<DecayedDataType::PType, Op>::vector(col->get_data(),
149149
vec_res);
150150
block.replace_by_position(result, std::move(col_res));
151151
return true;

0 commit comments

Comments
 (0)