yiguolei commented on code in PR #50290: URL: https://github.com/apache/doris/pull/50290#discussion_r2057470463
########## be/src/vec/data_types/data_type_decimal.h: ########## @@ -150,22 +150,12 @@ class DataTypeDecimal final : public IDataType { const char* get_family_name() const override { return "Decimal"; } std::string do_get_name() const override; TypeIndex get_type_id() const override { return TypeId<T>::value; } - TypeDescriptor get_type_as_type_descriptor() const override { - TypeDescriptor desc; - if constexpr (std::is_same_v<TypeId<T>, TypeId<Decimal32>>) { - desc = TypeDescriptor(TYPE_DECIMAL32); - } else if constexpr (std::is_same_v<TypeId<T>, TypeId<Decimal64>>) { - desc = TypeDescriptor(TYPE_DECIMAL64); - } else if constexpr (std::is_same_v<TypeId<T>, TypeId<Decimal128V3>>) { - desc = TypeDescriptor(TYPE_DECIMAL128I); - } else if constexpr (std::is_same_v<TypeId<T>, TypeId<Decimal256>>) { - desc = TypeDescriptor(TYPE_DECIMAL256); - } else { - desc = TypeDescriptor(TYPE_DECIMALV2); - } - desc.scale = scale; - desc.precision = precision; - return desc; + PrimitiveType get_primitive_type() const override { + return IsDecimal256<T> ? PrimitiveType::TYPE_DECIMAL256 + : IsDecimal128V3<T> ? PrimitiveType::TYPE_DECIMAL128I + : IsDecimalV2<T> ? PrimitiveType::TYPE_DECIMALV2 + : IsDecimal64<T> ? PrimitiveType::TYPE_DECIMAL64 Review Comment: 不要定义这些IsDecimal64。 直接用typeid 判断是否相等就行了。std::is_same -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org