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

timeFrom error #268

Closed
dacevedo12 opened this issue Aug 8, 2023 · 3 comments
Closed

timeFrom error #268

dacevedo12 opened this issue Aug 8, 2023 · 3 comments
Labels
datasource/Athena type/bug Something isn't working

Comments

@dacevedo12
Copy link

What happened:

I'm using the following query
SELECT $__timeFrom() AT TIME ZONE 'America/Bogota'

And get this error
parsing time "2023-08-01 14:14:33" as "2006-01-02 15:04:05.000": cannot parse "" as ".000": Could not process SQL results

What you expected to happen:

I expected the format returned by timeFrom to be seamlessly compatible with athenea

Environment:

  • Grafana version: AWS managed grafana v8.4.7
  • Plugin version: 2.2.0
  • OS Grafana is installed on: n/a
  • User OS & Browser: n/a
  • Others: n/a
@idastambuk
Copy link
Contributor

idastambuk commented Aug 9, 2023

Hi @dacevedo12!
Can you try using $__rawTimeFrom() with the format you need as argument and see if that works? You can find the docs for this here.
Let me know if that works!

Edit: Sorry, wrong link!

@idastambuk idastambuk moved this from Incoming to Waiting in AWS Datasources Aug 9, 2023
@idastambuk
Copy link
Contributor

Hi @dacevedo12, have you managed to get this working for you?

@dacevedo12
Copy link
Author

I solved it like this: SELECT CAST($__timeFrom() AS timestamp) AT TIME ZONE 'America/Bogota'

@github-project-automation github-project-automation bot moved this from Waiting to Done in AWS Datasources Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasource/Athena type/bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants