-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix unified_log handling of timestamp formats
#8451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unified_log handling of timestamp formats
#8451
Conversation
The log entries timestamp is a double, we need to ensure that it's cast to an integer when returning it as a result to sqlite and using a timestamp constraint, otherwise sqlite will filter out all the entries that have the decimal part in them.
|
|
||
| r["timestamp"] = BIGINT([[entry date] timeIntervalSince1970]); | ||
| r["timestamp"] = BIGINT( | ||
| static_cast<std::uint32_t>([[entry date] timeIntervalSince1970])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the spirit of not losing information, do you think it makes sense to also pass a float through? (timestamp_float or something)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure (I would call it timestamp_double to respect the true type).
|
There's an additional problem I did not consider. When writing a constraint like The solution here is to actually pass the timestamp in the constraint + 1, if the constraint is using |
|
This should do, although there are still some interesting questions around the |
unified_log handling of timestamp formats
The log entries timestamp is a double, we need to ensure that it's cast to an integer when returning it as a result to sqlite and using a timestamp constraint, otherwise sqlite will filter out all the entries that have the decimal part in them.