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

IN operator not correctly constructed in Query Builder Filter #830

Closed
ryn9 opened this issue May 13, 2024 · 5 comments · Fixed by #837
Closed

IN operator not correctly constructed in Query Builder Filter #830

ryn9 opened this issue May 13, 2024 · 5 comments · Fixed by #837

Comments

@ryn9
Copy link

ryn9 commented May 13, 2024

What happened:
When constructing a query using Query Builder, if using the 'IN' operator for a filter, the generated SQL is not correct

What you expected to happen:
the generated SQL for XXX IN (1,2,3) would be expected to be
XXX IN (1,2,3)
Instead it produces
XXX IN '(1,2,3)'

How to reproduce it (as minimally and precisely as possible):

  1. Go to Query Builder, Query Type: Time Series
  2. Create a Filter using the 'IN' operator
  3. View the generated SQL Preview

Anything else we need to know?:
n/a

Environment:

  • Grafana version:
  • Plugin version: grafana-clickhouse-datasource v4.0.7
  • OS Grafana is installed on:
  • User OS & Browser:
  • Others:
@Guille-vn
Copy link

I reported something similar . It's seems like "Clickhouse" connector is not working well

@ryn9
Copy link
Author

ryn9 commented May 14, 2024

@Guille-vn do you have a link to your issue?
The data source plugin has actually been working quite well in my tests, but like anything, there are some bugs.

@Guille-vn
Copy link

@Guille-vn do you have a link to your issue? The data source plugin has actually been working quite well in my tests, but like anything, there are some bugs.

Sure

grafana/grafana#87573
#828

@SpencerTorres
Copy link
Collaborator

Thank you for submitting this issue, I am able to reproduce this bug. This is an issue with the SQL generator converting the input to a string instead of splitting into a proper array, I will look into this and let you know when I push a fix.

Thanks!

@Kenterfie
Copy link
Contributor

We are currently using version 4.0.8 and still have the same problem. When I use the IN operator for ad hoc filters, it still outputs '(1,2,3)' instead of (1,2,3). We switched our dashboards from Altinity to this one a few weeks ago and didn't have similar issues before. I suspect the problem was only solved for a part of the plugin and not in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
5 participants