Don't push down functions by default#245
Merged
Merged
Conversation
6726175 to
677d1ab
Compare
d8d091f to
6360d56
Compare
theory
requested changes
May 10, 2026
Collaborator
theory
left a comment
There was a problem hiding this comment.
Much better than before. Good to have this cleaned up to avoid the legacy of the fork from postgres_fdw.
Seems like we could use a few more tests though, yes?
6360d56 to
5ed2a0a
Compare
Member
Author
|
heavily expanded test suite. also fixed deparsing bytea, as ch doesn't support pg bytea syntax for strings |
5ed2a0a to
813a604
Compare
theory
approved these changes
May 11, 2026
Make builtin function pushdown opt-in: Postgres builtins now ship to ClickHouse only when explicitly mapped, so name or signature differences cannot silently alter results. Add explicit mappings for `mod`, `pow`/`power`, `bit_count(bytea)`, and `reverse(text)` (→ `reverseUTF8`) to retain previously working pushdowns. Fix `editDistance`, `length(text)` and `strpos(text, text)` pushdown to map to `lengthUTF8` and `positionUTF8` rather than ClickHouse's byte-counting `length` and `position`, matching Postgres character semantics. Stop pushing down `asin`, `acos`, `atanh`, and `acosh`: Postgres raises an error on out-of-range input where ClickHouse returns `NaN`. Evaluating locally preserves Postgres semantics. Add comprehensive tests for all of these behaviors. Signed-off-by: David E. Wheeler <david.wheeler@clickhouse.com>
813a604 to
6a0cb8e
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.
Explicitly add functions which were falling through correctly by default
Include mapping mod/pow/power/bit_count/reverse/bit_and/bit_or/bit_xor
length(text)in PG is actuallylengthUTF8in CHasin/acos/atanh/acosh not pushed down for now since they need range checks: on PG out-of-range is error, whereas on CH out-of-range returns NaN