HappenLee commented on code in PR #9582: URL: https://github.com/apache/incubator-doris/pull/9582#discussion_r891422484
########## be/src/vec/data_types/data_type_factory.cpp: ########## @@ -26,13 +26,75 @@ namespace doris::vectorized { DataTypePtr DataTypeFactory::create_data_type(const doris::Field& col_desc) { Review Comment: You should simplify this code by making call `DataTypeFactory::create_data_type(const TabletColumn& col_desc, bool is_nullable)`. do not have two big and same `switch` ########## be/src/vec/functions/function_binary_arithmetic.h: ########## @@ -529,6 +565,31 @@ struct DecimalBinaryOperation { return apply(a, b, is_null); } } + + template <bool scale_left> + static NativeResultType apply_scaled_mod(NativeResultType a, NativeResultType b, + NativeResultType scale, UInt8& is_null) { + if constexpr (OpTraits::is_mod) { Review Comment: if not `is_mod` return nothing? ########## be/src/vec/olap/olap_data_convertor.h: ########## @@ -182,12 +182,56 @@ class OlapBlockDataConvertor { Status convert_to_olap() override; }; + // For compatibility with decimalv2. + // Convert the decimal32/decimal64/decimal128 of the computing + // layer to decimal12_t of the storage layer. + template <typename T> class OlapColumnDataConvertorDecimal : public OlapColumnDataConvertorPaddedPODArray<decimal12_t> { public: Status convert_to_olap() override; }; + // decimalv3 don't need to do any convert + template <typename T> + class OlapColumnDataConvertorDecimalV3 : public OlapColumnDataConvertorBase { Review Comment: should be a subclass of `OlapColumnDataConvertorSimple` only need override the `convert_to_olap` method ########## be/src/vec/sink/mysql_result_writer.cpp: ########## @@ -144,6 +145,35 @@ Status VMysqlResultWriter::_add_one_column(const ColumnPtr& column_ptr, _buffer.close_dynamic_mode(); result->result_batch.rows[i].append(_buffer.buf(), _buffer.length()); } + } else if (type == TYPE_DECIMALV2 && config::enable_execution_decimalv3) { Review Comment: why the code here not 234 line like ``` if (config::enable_execution_decimalv3) { ..... } else { DecimalV2Value ... } ``` -- 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