[Feature] Handle non-deterministic queries
Is your feature request related to a problem? Please describe.
Right now, using functions like now() would end up cached even though they're different queries over time
CH query caching handles them via parameter query_cache_nondeterministic_function_handling, but using chproxy they can silently end up cached.
Describe the solution you'd like
I want to have an opt-in parameter to handle them specially, so one can use same client to execute both queries and have more reliable results.
I can submit a pr but want to know if this is desired or there's a suggested alternative.
Describe alternatives you've considered
Tried using CH's query cache but doing it in chproxy is better for our usecase to not overload CH
The alternative I see is to use the no_cache=1 http parameter to bypass the cache in this situation.
The alternative I see is to use the
no_cache=1http parameter to bypass the cache in this situation.
yep, its the way im dealing with it
the issue is that it means we need to have a wrapper of the client just to check for non-deterministic inputs in the query and then assign the param no_cache selectively
for more context on why this is desired, im using python client clickhouse_connect
to add a request query param, one needs to do (undocumented, but hack around):
- set
clickhouse_connect.common.set_setting("invalid_setting_action", "send") - append on each request the kwarg
{"no_cache": "1"}undersettings