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

Support casting string to timestamp with microsecond resolution #3751

Closed
gruuya opened this issue Feb 23, 2023 · 0 comments · Fixed by #3752
Closed

Support casting string to timestamp with microsecond resolution #3751

gruuya opened this issue Feb 23, 2023 · 0 comments · Fixed by #3752
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog

Comments

@gruuya
Copy link
Contributor

gruuya commented Feb 23, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

I'm trying to migrate Seafowl's storage backend to use delta-rs, and one issue that has come up is the fact that the DELTA protocol prescribes that timestamp resolution should be in microseconds. On the other hand, the current casting logic only supports nanoseconds resolution.

Describe the solution you'd like
Ideally, we'd be able to cast a Utf8/LargeUtf8 type to Timestamp(TimeUnit::Microsecond, _), like we already do for Timestamp(TimeUnit::Nanosecond, _) (even with potential precision loss).

The microsecond resolution of the fractional part of the string timestamp is the default offered for most other systems, e.g. Postgres, MySQL, BigQuery, etc.

Describe alternatives you've considered
Perform manual conversion of string to timestamp[us] in some places, possibly prohibiting usage of some high level datafusion/delta-rs interfaces.

Alternatively, enforce users to always call to_timestamp_micros datafusion function when specifying timestamp strings.

Additional context

@gruuya gruuya added the enhancement Any new improvement worthy of a entry in the changelog label Feb 23, 2023
@tustvold tustvold added the arrow Changes to the arrow crate label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants