zyp-V commented on code in PR #65116:
URL: https://github.com/apache/doris/pull/65116#discussion_r3526870465
##########
be/src/core/data_type_serde/data_type_number_serde.cpp:
##########
@@ -867,22 +875,30 @@ void
DataTypeNumberSerDe<T>::write_one_cell_to_jsonb(const IColumn& column,
// both unsigned integers in Doris types and the JSONB types.
if constexpr (T == TYPE_TINYINT || T == TYPE_BOOLEAN) {
int8_t val = *reinterpret_cast<const int8_t*>(data_ref.data);
- result.writeInt8(val);
+ result.writeInt(val);
} else if constexpr (T == TYPE_SMALLINT) {
int16_t val = *reinterpret_cast<const int16_t*>(data_ref.data);
- result.writeInt16(val);
- } else if constexpr (T == TYPE_INT || T == TYPE_DATEV2 || T == TYPE_IPV4) {
+ result.writeInt(val);
+ } else if constexpr (T == TYPE_INT || T == TYPE_DATEV2) {
+ int32_t val = *reinterpret_cast<const int32_t*>(data_ref.data);
+ result.writeInt(val);
+ } else if constexpr (T == TYPE_IPV4) {
int32_t val = *reinterpret_cast<const int32_t*>(data_ref.data);
result.writeInt32(val);
} else if constexpr (T == TYPE_BIGINT || T == TYPE_DATE || T ==
TYPE_DATETIME ||
T == TYPE_DATETIMEV2 || T == TYPE_TIMESTAMPTZ) {
int64_t val = *reinterpret_cast<const int64_t*>(data_ref.data);
- result.writeInt64(val);
+ result.writeInt(val);
Review Comment:
Yes, this supports new readers reading old data, not old readers reading new
data, meaning it does not support rollback.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]