diff --git a/be/src/runtime/datetime_value.h b/be/src/runtime/datetime_value.h index 12aa25e2c155a4..9ddb1fab467435 100644 --- a/be/src/runtime/datetime_value.h +++ b/be/src/runtime/datetime_value.h @@ -167,12 +167,12 @@ class DateTimeValue { DateTimeValue() : _neg(0), _type(TIME_DATETIME), - _second(0), - _minute(0), _hour(0), - _day(0), - _month(0), + _minute(0), + _second(0), _year(0), + _month(0), + _day(0), _microsecond(0) {} explicit DateTimeValue(int64_t t) { from_date_int64(t); } @@ -625,15 +625,17 @@ class DateTimeValue { bool from_date_format_str(const char* format, int format_len, const char* value, int value_len, const char** sub_val_end); - // 1 bits for neg. 3 bits for type. 12bit for second + // NOTICE: it's dangerous if you want to modify the memory structure of datetime + // which will cause problem in serialization/deserialization of RowBatch. + // 1 bits for neg. 3 bits for type. 12bit for hour uint16_t _neg : 1; // Used for time value. uint16_t _type : 3; // Which type of this value. - uint16_t _second : 12; + uint16_t _hour : 12; uint8_t _minute; - uint8_t _hour; - uint8_t _day; - uint8_t _month; + uint8_t _second; uint16_t _year; + uint8_t _month; + uint8_t _day; // TODO(zc): used for nothing uint64_t _microsecond; @@ -641,12 +643,12 @@ class DateTimeValue { uint32_t microsecond, uint16_t year, uint8_t month, uint8_t day) : _neg(neg), _type(type), - _second(second), - _minute(minute), _hour(hour), - _day(day), - _month(month), + _minute(minute), + _second(second), _year(year), + _month(month), + _day(day), _microsecond(microsecond) {} // RE2 obj is thread safe