cherry pick from #42031 #42188 --------- Co-authored-by: Tiewei Fang <43782773+BePPPower@users.noreply.github.com> Co-authored-by: TieweiFang <ftw2139@163.com>
This commit is contained in:
@ -32,8 +32,6 @@ enum {
|
||||
};
|
||||
|
||||
namespace doris::vectorized {
|
||||
static const int64_t timestamp_threshold = -2177481943;
|
||||
static const int64_t timestamp_diff = 343;
|
||||
static const int64_t micr_to_nano_second = 1000;
|
||||
|
||||
Status DataTypeDateTimeV2SerDe::serialize_column_to_json(const IColumn& column, int start_idx,
|
||||
@ -232,14 +230,6 @@ Status DataTypeDateTimeV2SerDe::write_column_to_orc(const std::string& timezone,
|
||||
return Status::InternalError("get unix timestamp error.");
|
||||
}
|
||||
|
||||
// -2177481943 represent '1900-12-31 23:54:17'
|
||||
// but -2177481944 represent '1900-12-31 23:59:59'
|
||||
// so for timestamp <= -2177481944, we subtract 343 (5min 43s)
|
||||
// Reference: https://www.timeanddate.com/time/change/china/shanghai?year=1900
|
||||
if (timezone == TimezoneUtils::default_time_zone && timestamp < timestamp_threshold) {
|
||||
timestamp -= timestamp_diff;
|
||||
}
|
||||
|
||||
cur_batch->data[row_id] = timestamp;
|
||||
cur_batch->nanoseconds[row_id] = datetime_val.microsecond() * micr_to_nano_second;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user