Skip to content

Allow nullable key in MergeTree#12433

Merged
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
amosbird:np
Jul 13, 2020
Merged

Allow nullable key in MergeTree#12433
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
amosbird:np

Conversation

@amosbird
Copy link
Copy Markdown
Collaborator

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Allow Nullable types as keys in MergeTree tables. #5319

Detailed description / Documentation draft:

A new setting allow_nullable_key is created which enables this feature. The default value is false.

NULLs comparison order is NULLS_LAST, which is based on #8834

@robot-clickhouse robot-clickhouse added doc-alert pr-feature Pull request with new product feature labels Jul 12, 2020
@amosbird
Copy link
Copy Markdown
Collaborator Author

Irrelevant failure due to test is flaky.

@alexey-milovidov alexey-milovidov self-assigned this Jul 13, 2020
Copy link
Copy Markdown
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

But for full support we also have to implement IS NULL, IS NOT NULL in KeyCondition.

@alexey-milovidov alexey-milovidov merged commit ae7eff9 into ClickHouse:master Jul 13, 2020
@calebeaires
Copy link
Copy Markdown

calebeaires commented Aug 26, 2020

Is this feature implemented? Based on the example above I cant create the table

CREATE TABLE nullable_key 
      (k Nullable(int), v int) ENGINE MergeTree ORDER BY k SETTINGS allow_nullable_key = 1;

Error
Code: 36, e.displayText() = DB::Exception: Unknown setting allow_nullable_key for storage MergeTree (version 20.6.4.44 (official build))

@alexey-milovidov
Copy link
Copy Markdown
Member

It's available from version 20.7.

@yanchaoguo
Copy link
Copy Markdown

你好 虽然20.7版本在create table 时解决了这个问题,但是新的MaterializeMySQL Feature是自动创建表的,如故mysql中存在索引为NULL时依然会报错

@zhang2014
Copy link
Copy Markdown
Contributor

@yanchaoguo fixed in #14397

@yanchaoguo
Copy link
Copy Markdown

@yanchaoguo fixed in #14397

Which version will be merged

@filimonov
Copy link
Copy Markdown
Contributor

#5319

@filimonov
Copy link
Copy Markdown
Contributor

Which version will be merged

20.7

@yanchaoguo
Copy link
Copy Markdown

yanchaoguo commented Sep 3, 2020

Which version will be merged

20.7

你好 虽然20.7版本在create table 时解决了这个问题,但是新的MaterializeMySQL Feature是自动创建表的,如故mysql中存在索引为NULL时依然会报错

Upd (machine translation) : Hello. Although the 20.7 version solved this problem when creating table, the new MaterializeMySQL Feature automatically creates the table. If there is an index in mysql, it will still report an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature Pull request with new product feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants