grafana / clickhouse-datasource

Grafana Plugin for ClickHouse
Apache License 2.0
127 stars 58 forks source link

Ad hoc filter values ​​are incorrectly escaped when used with the IN operator #883

Closed Kenterfie closed 2 weeks ago

Kenterfie commented 2 months ago

What happened: We switched some weeks ago from the Altinity plugin for clickHouse to the official grafana clickhouse source plugin and we noticed that something was not working anymore as expected. We use extensively the in operator in our ad-hoc filters, which works fine with the previous plugin, but now the values are incorrectly escaped.

settings additional_table_filters={'table' : ' IPv4NumToStringClassC(ipv4Dst) IN \'('1.1.1.xxx','2.2.2.xxx')\' '}

What you expected to happen: settings additional_table_filters={'table' : ' IPv4NumToStringClassC(ipv4Dst) IN (\'1.1.1.xxx\',\'2.2.2.xxx\')'}

Anything else we need to know?:

Environment:

SpencerTorres commented 1 month ago

Could you add some more detail about where the adhoc filter is getting its values? Also what the query looks like? Is it a SQL editor query, or query builder?

bossinc commented 2 weeks ago

@Kenterfie I'm closing this issue. If it is still an issue, please reopen it with answers to Spencer's questions. Thank you!