-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix default ad hoc filters #650
Conversation
This makes sense but, I am not able to make this work. I am using the default |
@bossinc How are you adding the adhoc var? With that dashboard, I can add it via the |
@bossinc Ah, I think I know what you mean. You're creating a new variable on the dashboard level, type Seems that's another case that's not working (and hasn't worked before this PR, either). I've fixed that as well now. Can you check that it's working for you? |
@cwurm I think we are talking about two difference ad-hoc filters. I did not know that you could make overrides for ad-hoc filters in tables like you described. 😆 |
Ah, crossed wires! This should be working as well now as per my previous comment.
Hm, from what I can see, overrides also change the ClickHouse query. |
This PR looks good. |
According to the README, it should be possible to use ad hoc filters without any special configuration:
clickhouse-datasource/README.md
Line 211 in 2573f94
But that's actually not the case. The current logic sets the target table for the filter to
default
when$clickhouse_adhoc_query
is not set. This then leads to a query with a setting likeSETTINGS additional_table_filters = {'default':' field = value }
that doesn't work because it's not specifying the correct table.This fix removes setting the target table to
default
(which seems weird in any case since there isn't usually a table like that in ClickHouse; there is only a database by that name) and sets it to the table from the query instead if no table has been specified any other way. With that, ad hoc filters work without setting$clickhouse_adhoc_query
or a default database in the datasource settings.Fixes #599.