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

Proposal: within time range syntax #3755

Open
killme2008 opened this issue Apr 19, 2024 · 0 comments
Open

Proposal: within time range syntax #3755

killme2008 opened this issue Apr 19, 2024 · 0 comments
Labels
C-feature Category Features

Comments

@killme2008
Copy link
Contributor

What type of enhancement is this?

API improvement, User experience

What does the enhancement do?

If the user wants to query the rows in a given year, date, or minute currently, they must specify the query conditions such as:

select * from monitors where ts >= '2024-01-01 00:00:00' and ts < '2025-01-01 00:00:00';

select * from monitors where ts >= '2024-04-19 00:00:00' and ts < '2024-04-20 00:00:00';

select * from monitors where ts >= '2024-04-19 23:50:00' and ts < '2024-04-19 23:51:00';

It would be better to provide a syntax sugar that helps users simplify the query:

select * from monitors where ts within '2024';

select * from monitors where ts within '2024-04-19';

select * from monitors where ts within '2024-04-19 23:50';

The predicate [column] WITHIN [TIMESTAMP] that will be transformed into

[column] >= [TIMESTAMP start] and [column] < [TIMESTAMP + 1 interval]

The interval is chosen based on TIMESTAMP precision.

Implementation challenges

No response

@killme2008 killme2008 added the C-feature Category Features label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category Features
Projects
None yet
Development

No branches or pull requests

1 participant