zhiqiang-hhhh commented on code in PR #32518: URL: https://github.com/apache/doris/pull/32518#discussion_r1536588367
########## be/src/vec/data_types/data_type_decimal.h: ########## @@ -655,6 +656,10 @@ void convert_to_decimal(typename ToDataType::FieldType* dst, for (size_t i = 0; i < size; ++i) { dst[i].value = FromFieldType(src[i] * multiplier.value + ((src[i] >= 0) ? 0.5 : -0.5)); } + } else if constexpr (IsDateV2Type<FromDataType>) { + for (size_t i = 0; i < size; ++i) { + dst[i].value = reinterpret_cast<const DateV2Value<DateV2ValueType>&>(src[i]).to_int64(); Review Comment: 1. maybe `assert_cast<const DateV2Value<FromFieldType>&>` is better 2. why convert result to int64? what if target Decimal is Decimal32 or Decimal128? -- 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