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 nanoseconds in doc store #2486

Merged
merged 3 commits into from
Oct 18, 2024
Merged

store DateTime as nanoseconds in doc store #2486

merged 3 commits into from
Oct 18, 2024

Conversation

PSeitz
Copy link
Contributor

@PSeitz PSeitz commented Sep 4, 2024

The doc store DateTime was truncated to microseconds previously. This
removes this truncation, while still keeping backwards compatibility.

This is done by passing the doc store version to the DocumentBinarySerializer and having different deserialization logic depending on the version for dates.

bump version format to 7.
add compat test to check the date time truncation.

closes #2380

@fmassot
Copy link
Contributor

fmassot commented Sep 25, 2024

@fulmicoton can you review it?

common/src/serialize.rs Outdated Show resolved Hide resolved
self.write_type_code(type_codes::HIERARCHICAL_FACET_CODE)?;

Cow::Borrowed(val).serialize(self.writer)
self.serialize_with_type_code(type_codes::DATE_CODE, &val)
Copy link
Collaborator

@fulmicoton fulmicoton Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just have some short date specific code here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I moved the version handling here

Copy link
Collaborator

@fulmicoton fulmicoton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on the DocumentBinarySerializer is a great idea. Introducing a ConfigurableBinarySerializer is overkill at this point however. Can we just push the logic on the date specific method in de.rs, se.rs.

The doc store DateTime was truncated to microseconds previously. This
removes this truncation, while still keeping backwards compatibility.

This is done by adding the trait `ConfigurableBinarySerializable`, which
works like `BinarySerializable`, but with a config that allows de/serialize
as different date time precision currently.

bump version format to 7.
add compat test to check the date time truncation.
@PSeitz PSeitz merged commit 2f2db16 into main Oct 18, 2024
4 checks passed
@PSeitz PSeitz deleted the doc_store_nano_prec branch October 18, 2024 02:50
Weijun-H pushed a commit to Weijun-H/tantivy that referenced this pull request Nov 10, 2024
* store DateTime as nanoseconds in doc store

The doc store DateTime was truncated to microseconds previously. This
removes this truncation, while still keeping backwards compatibility.

This is done by adding the trait `ConfigurableBinarySerializable`, which
works like `BinarySerializable`, but with a config that allows de/serialize
as different date time precision currently.

bump version format to 7.
add compat test to check the date time truncation.

* remove configurable binary serialize, add enum for doc store version

* test doc store version ord
Weijun-H pushed a commit to Weijun-H/tantivy that referenced this pull request Nov 10, 2024
* store DateTime as nanoseconds in doc store

The doc store DateTime was truncated to microseconds previously. This
removes this truncation, while still keeping backwards compatibility.

This is done by adding the trait `ConfigurableBinarySerializable`, which
works like `BinarySerializable`, but with a config that allows de/serialize
as different date time precision currently.

bump version format to 7.
add compat test to check the date time truncation.

* remove configurable binary serialize, add enum for doc store version

* test doc store version ord
philippemnoel pushed a commit to paradedb/tantivy that referenced this pull request Nov 13, 2024
* store DateTime as nanoseconds in doc store

The doc store DateTime was truncated to microseconds previously. This
removes this truncation, while still keeping backwards compatibility.

This is done by adding the trait `ConfigurableBinarySerializable`, which
works like `BinarySerializable`, but with a config that allows de/serialize
as different date time precision currently.

bump version format to 7.
add compat test to check the date time truncation.

* remove configurable binary serialize, add enum for doc store version

* test doc store version ord
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

Successfully merging this pull request may close these issues.

Store DateTime as nanos in docstore
3 participants