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

Timestamp Serialization Should Not Be Fixed to Nanoseconds #274

Closed
almann opened this issue Jun 2, 2021 · 1 comment
Closed

Timestamp Serialization Should Not Be Fixed to Nanoseconds #274

almann opened this issue Jun 2, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@almann
Copy link
Contributor

almann commented Jun 2, 2021

#272 ports some internal code to APIs, part of this is a TODO to make Timestamp serialization to be not fixed to nanoseconds.

When searching for prior issues, I found #17, but I am not sure if that is different or already resolved (since it indicates skipping fractional seconds). @zslayton can probably confirm this.


So this means that if there exists sub-second precision, that precision is always nine digits (i.e. nanoseconds)?

Originally posted by @almann in #272 (comment)

@zslayton
Copy link
Contributor

zslayton commented Jun 2, 2021

Prior to #272, the binary reader/writer only worked with DateTime<_>, which represents its fractional seconds as nanoseconds. Both reading and writing had a TODO to support other levels of precision.

Now that we're supporting reading and writing Timestamps (which natively support setting/getting the precision), assuming nanoseconds on this code path no longer makes sense.

@almann almann added the enhancement New feature or request label Jun 3, 2021
@marcbowes marcbowes mentioned this issue Jun 14, 2021
8 tasks
marcbowes added a commit to marcbowes/ion-rust that referenced this issue Jun 14, 2021
This commit uses the new decimal encoder to encode fractional timestamps
as a decimal. Two timestamp tests that were failing now pass!
marcbowes added a commit that referenced this issue Jun 15, 2021
This commit uses the new decimal encoder to encode fractional timestamps
as a decimal. Two timestamp tests that were failing now pass!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants