Skip to content
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

Store DateTime as nanos in docstore #2380

Open
trinity-1686a opened this issue Apr 26, 2024 · 2 comments
Open

Store DateTime as nanos in docstore #2380

trinity-1686a opened this issue Apr 26, 2024 · 2 comments
Assignees

Comments

@trinity-1686a
Copy link
Contributor

we use BinarySerializable to encode datetimes into the doc store. Strangely, while DateTime are precise up to ns, we only store µs there. We should store the value we got with full precision instead

impl BinarySerializable for DateTime {
fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> std::io::Result<()> {
let timestamp_micros = self.into_timestamp_micros();
<i64 as BinarySerializable>::serialize(&timestamp_micros, writer)
}
fn deserialize<R: Read>(reader: &mut R) -> std::io::Result<Self> {
let timestamp_micros = <i64 as BinarySerializable>::deserialize(reader)?;
Ok(Self::from_timestamp_micros(timestamp_micros))
}
}

@guilload guilload changed the title docstore stores DateTime as micros Store DateTime as nanos in docstore Apr 26, 2024
@fulmicoton
Copy link
Collaborator

We need to be careful with backward compatiblity with that one.

Is it motivated by a problem observed on quickwit side? Is there a ticket open somewhere?

@trinity-1686a
Copy link
Contributor Author

it was observed that when asked to return nanoseconds, quickwit returns values truncated to microsecond precision. This is surprising, and potentially problematic for use-cases relying on high precision timestamps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants