Hi everyone,
Thanks a lot for this dashboarding tool.
I am using the SQL option to create Superset view to get dynamique view, from some filter value. And it works wells, however I noticed the "Enable Filter Select"/"Fetch Values Predicate" option and I was wondering, how these two option works. I did not find documentation about those, if any can point me to one it would be awesome.
Does this allow us to get dynamic table according to a particular values ?
Thanks for your time.
It's for lowering the cost of fetching the value by using a predicate typically on an indexed or partitioned field. For instance if your table is partitioned by a field name ds, you can add Fetch Values Predicate that looks something like ds >= DATE_ADD(NOW(), DAYS, 7) or something of that nature. That way Superset, when populating the autocomplete values, will add this predicate to the SELECT DISTINCT {column_to_be_filtered_on} FORM {table} WHERE {fetch_values_predicate}.
Great!
I think that the usage of 'fetch_values_predicate' should be added to the documents.
@vnnw
Have you managed to get this working?
I tried many cases but I never saw the WHERE condition appearing in my queries :(
I am using Superset 0.28.1
@lilila
No. the WHERE condition won't appear in the running queries as you get it by clicking on the upper right button "View Query", if I understand you right.
The 'fetch_values_predicate', as its name suggests, controls how you will get the available values for the filters in the lower left section 'Filters', so you must use it with 'Enable Filter Select' checked, as the snapshot bellow .

When you add a column into a filter, Superset will fetch the available unique values of this column for you to select from. Then 'fetch_values_predicate' puts the WHERE condition on the query fetching values, so you won't see it and it is also unnecessary.
Thanks for your time and your answer. I get how this features works.
Also pushed this to help: https://github.com/apache/incubator-superset/pull/6171
Most helpful comment
It's for lowering the cost of fetching the value by using a predicate typically on an indexed or partitioned field. For instance if your table is partitioned by a field name
ds, you can addFetch Values Predicatethat looks something likeds >= DATE_ADD(NOW(), DAYS, 7)or something of that nature. That way Superset, when populating the autocomplete values, will add this predicate to theSELECT DISTINCT {column_to_be_filtered_on} FORM {table} WHERE {fetch_values_predicate}.