-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Unconditionally pushdown varchar predicate to Clickhouse #23516
Unconditionally pushdown varchar predicate to Clickhouse #23516
Conversation
ClickHouse collation is case-sensitive. ClickHouse has same sort ordering as Trino. Per https://clickhouse.com/docs/en/sql-reference/statements/show#show_columns ClickHouse has no per-column collations Clickhouse is UTF-8 encoded with byte-by-byte comparison. https://clickhouse.com/docs/en/sql-reference/statements/select/order-by#collation-support So exactly as trino. https://github.com/airlift/slice/blob/2.2/src/main/java/io/airlift/slice/Slice.java#L1205 That’s why all operations on varchars may pushdown.
6a9e660
to
2944caf
Compare
ClickHouse supports collation at an index level. https://clickhouse.com/docs/en/sql-reference/statements/show#show-index |
@ebyhr IIUC DB does not use index if query condition does not match index parameters.
it means that ordering for index matched order requested by query and ClickHouse executes query faster. |
Checking Actually, ClickHouse supports specifying column collation for new tables: CREATE TABLE test (x varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL) ENGINE = Memory; It's just allowed at syntax level and it doesn't affect results as far as I tested locally, though. |
ClickHouse collation is case-sensitive.
ClickHouse has same sort ordering as Trino.
Per https://clickhouse.com/docs/en/sql-reference/statements/show#show_columns
ClickHouse has no per-column collations
Clickhouse is UTF-8 encoded with byte-by-byte comparison.
https://clickhouse.com/docs/en/sql-reference/statements/select/order-by#collation-support
So exactly as trino.
https://github.com/airlift/slice/blob/2.2/src/main/java/io/airlift/slice/Slice.java#L1205
That’s why all operations on varchars may pushdown.
Description
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: