4paradigm / OpenMLDB

OpenMLDB is an open-source machine learning database that provides a feature platform computing consistent features for training and inference.
https://openmldb.ai
Apache License 2.0
1.58k stars 317 forks source link

work with dates before 1900 or timestamp before 1970 #3501

Open aceforeverd opened 1 year ago

aceforeverd commented 1 year ago

One approach: both type are string from storage, following a standard like ISO 8601. The SQL execute engine parse it into the date and timestamp type that supports it, which are the internal structure do not counts to user

aceforeverd commented 1 year ago

For date type in storage: the year field is stored in 16bit, consider sufficient for year in range 1900 + [-2^15, 2^15-1]

aceforeverd commented 8 months ago

for timestamp, typically stored as a 64-bit integer representing seconds since the "Unix epoch" of 1970-01-01 00:00:00 UTC. Positive integers are times after the epoch, negative before