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

refactor(types): spilt timestamp to timestamp and timestampnano #20192

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

xxhZs
Copy link
Contributor

@xxhZs xxhZs commented Jan 17, 2025

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

in #19827, we support timestamp with nano, but we can't support interval with nano in a similar way. So we have to introduce the new type, and correspondingly, we should implement the new type timestamp_nano, so we distinguish between timestamp_nano and timestamp in this pr

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • My PR contains critical fixes that are necessary to be merged into the latest release.

Documentation

  • My PR needs documentation updates.
Release note

@xxhZs xxhZs marked this pull request as ready for review January 17, 2025 05:42
@xxhZs xxhZs requested review from xiangjinwu and chenzl25 January 23, 2025 06:41
Copy link

gru-agent bot commented Jan 23, 2025

This pull request has been modified. If you want me to regenerate unit test for any of the files related, please find the file in "Files Changed" tab and add a comment @gru-agent. (The github "Comment on this file" feature is in the upper right corner of each file in "Files Changed" tab.)

Copy link
Contributor

@chenzl25 chenzl25 left a comment

Choose a reason for hiding this comment

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

After this PR, what's the precision of the timestamp type?

@xxhZs
Copy link
Contributor Author

xxhZs commented Jan 23, 2025

After this PR, what's the precision of the timestamp type?

timestamp -> 6 us
timestampnano -> 9 ns

@chenzl25
Copy link
Contributor

After this PR, what's the precision of the timestamp type?

timestamp -> 6 us timestampnano -> 9 ns

I remembered timestamp should already be nano precision. Does it mean this is a breaking change?

@xiangjinwu
Copy link
Contributor

I remembered timestamp should already be nano precision. Does it mean this is a breaking change?

It was also a breaking change regarding the extract function when we upgraded the precision in #19827 - same expression returns different value in different version: 1.234567 vs 1.234567000.

@xxhZs
Copy link
Contributor Author

xxhZs commented Jan 24, 2025

It was also a breaking change regarding the extract function when we upgraded the precision in #19827 - same expression returns different value in different version: 1.234567 vs 1.234567000.

Yes. There should be no compatibility issues with this pr, but it will make some user behavior changes

@chenzl25
Copy link
Contributor

I remembered timestamp should already be nano precision. Does it mean this is a breaking change?

It was also a breaking change regarding the extract function when we upgraded the precision in #19827 - same expression returns different value in different version: 1.234567 vs 1.234567000.

I am ok with this PR to keep the timestamp with us precision and introduce a new timestampnano type to introduce nano precision timestamp. It can make the code clearer and it doesn't make too much sense to let timestamp and timestampnano have the same precision. What do you think @xiangjinwu

@xiangjinwu
Copy link
Contributor

I agree. I meant this breaking change is acceptable and can actually "fix"/revert a previous breaking change.

Copy link
Contributor

@chenzl25 chenzl25 left a comment

Choose a reason for hiding this comment

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

Considering other system nano timestamp type naming conventions, I think it's better to use timestamp_ns instead of timestampnano
https://arc.net/l/quote/xaiqjmve
https://duckdb.org/docs/sql/data_types/timestamp.html

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

Successfully merging this pull request may close these issues.

3 participants