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

adhoc filter generate wrong sql #162

Closed
libinyl opened this issue Aug 7, 2022 · 5 comments
Closed

adhoc filter generate wrong sql #162

libinyl opened this issue Aug 7, 2022 · 5 comments
Assignees
Labels
effort/none type/bug Something isn't working

Comments

@libinyl
Copy link

libinyl commented Aug 7, 2022

Describe the bug

ad hoc filter generated wrong sql ( missing quote ? ) when the column type is String and the value is a numeric string.

Versions
Grafana and Plugin versions.

Grafana version: 8.2.7
plugin version: 1.1.2

Query
please look at the screenshot below

Expected behavior

always generate correct sql

Screenshots
image

table description:

image

please forgive my poor english

@bossinc bossinc added the type/bug Something isn't working label Aug 8, 2022
@bossinc bossinc self-assigned this Aug 8, 2022
@bossinc
Copy link
Collaborator

bossinc commented Aug 8, 2022

I believe changes to Grafana core will need to be made to solve this issue. Right now we try to parse the ad hoc query
results into a number. If the results do not parse into a number we assume it's a string.

You could work around this issue by using a template variable for app_id and add a where clause to your query using the template variable.

@bossinc bossinc removed their assignment Aug 8, 2022
@libinyl
Copy link
Author

libinyl commented Aug 9, 2022

I believe changes to Grafana core will need to be made to solve this issue. Right now we try to parse the ad hoc query results into a number. If the results do not parse into a number we assume it's a string.

You could work around this issue by using a template variable for app_id and add a where clause to your query using the template variable.

thanks for the reply; BTW, does the Grafana team know about this issue, or have a plan to fix it? thanks again.

@bossinc
Copy link
Collaborator

bossinc commented Aug 10, 2022

I've made the team aware of this issue. I am not sure how/when this will be fixed. I'll update this issue when I learn more 🙂

@libinyl
Copy link
Author

libinyl commented Aug 11, 2022

I've made the team aware of this issue. I am not sure how/when this will be fixed. I'll update this issue when I learn more 🙂

thanks!!

@bossinc
Copy link
Collaborator

bossinc commented Jan 27, 2023

This should no longer be as of the 2.0 release. Please reopen if this is not fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/none type/bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants