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

tql eval supports SQL functions for start, end and step. #3452

Closed
killme2008 opened this issue Mar 7, 2024 · 1 comment
Closed

tql eval supports SQL functions for start, end and step. #3452

killme2008 opened this issue Mar 7, 2024 · 1 comment
Assignees
Labels
C-user-experience Category User Experience

Comments

@killme2008
Copy link
Contributor

killme2008 commented Mar 7, 2024

What type of enhancement is this?

API improvement, User experience

What does the enhancement do?

Current tql eval parser only accepts timestamp literal as start andend parameter, for example:

TQL eval (1677057993, 1677058993, '1m') rate(prometheus_http_requests_total{job="prometheus"}[5m]);

Refer to https://docs.greptime.com/reference/sql/tql#eval

I think it's better to accept SQL functions such as now() for these parameters:

TQL eval ((now() - '5 minute'::interval)/1000, now()/1000, '1m') rate(prometheus_http_requests_total{job="prometheus"}[5m]);

Additionally, it would be beneficial if we could simplify the syntax by adding some syntactic sugar:

TQL eval(now - '5m', now, '1m') rate(prometheus_http_requests_total{job="prometheus"}

Implementation challenges

No response

@killme2008 killme2008 added the C-user-experience Category User Experience label Mar 7, 2024
@etolbakov
Copy link
Collaborator

@killme2008 happy to give it a go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-user-experience Category User Experience
Projects
None yet
Development

No branches or pull requests

2 participants