Add clickhouse_push_fail() for params, dictGet#34
Merged
Conversation
92576be to
19a5f81
Compare
serprex
approved these changes
Nov 9, 2025
19a5f81 to
c14a509
Compare
Add a new function `clickhouse_push_fail()`, that just looks up the name of the SQL function and raises an exception reporting that it failed to be pushed down. Use it for `params()`, which previously would crash the server because it wasn't passing its function name to `clickhouse_func_push_fail()`. Also use `clickhouse_push_fail()` for `dictGet()`, and remove the now unused function `ch_push_func_text()`. The only side effect is that `clickhouse_push_fail()` reports PostgreSQL canonical function names, which is to say all lowercase, e.g., `dictget()` instead of `dictGet()`. To better represent that it reports pushdown failures for any operation passed as the first argument, rename `clickhouse_func_push_fail()` to `clickhouse_op_push_fail()`. While at it, test the pushdown failure of `params()` in `test/sql/function_pushdown.sql`; this call previously would crash the server. Also test the pushdown failure of `quantile()` and `quantileExact()`.
c14a509 to
0a5d31b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new function
clickhouse_push_fail(), that just looks up the nam of the SQL function and raises an exception reporting that it failed to be pushed down. Use it forparams(), which previously would crash the server because it wasn't passing its function name toclickhouse_func_push_fail().Also use
clickhouse_push_fail()fordictGet(), and remove the now unused functionch_push_func_text(). The only side effect is thatclickhouse_push_fail()reports PostgreSQL canonical function names, which is to say all lowercase, e.g.,dictget()instead ofdictGet().To better represent that it reports pushdown failures for any operation passed as the first argument, rename
clickhouse_func_push_fail()toclickhouse_op_push_fail().While at it, test the pushdown failure of
params()intest/sql/function_pushdown.sql; this call previously would crash the server. Also test the pushdown failure ofquantile()andquantileExact().