Skip to content

Add join_overwrite settings for StorageJoin.#3973

Merged
alexey-milovidov merged 4 commits intoClickHouse:masterfrom
amosbird:join_overwrite
Jan 23, 2019
Merged

Add join_overwrite settings for StorageJoin.#3973
alexey-milovidov merged 4 commits intoClickHouse:masterfrom
amosbird:join_overwrite

Conversation

@amosbird
Copy link
Copy Markdown
Collaborator

This makes using StorageJoin as dictionary more flexible.

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

StorageJoin now supports join_overwrite setting that allows overwriting existing values of the same key.

Category (leave one):

  • New Feature

@amosbird amosbird force-pushed the join_overwrite branch 4 times, most recently from 23eaf64 to d4e2fd2 Compare December 31, 2018 13:15
@alexey-milovidov
Copy link
Copy Markdown
Member

Some tests have failed.

@amosbird
Copy link
Copy Markdown
Collaborator Author

amosbird commented Jan 2, 2019

fixed along with some comments. The style errors don't look accurate to me.

@amosbird amosbird force-pushed the join_overwrite branch 3 times, most recently from 11f24ad to fe60fc8 Compare January 6, 2019 14:08
This makes using StorageJoin as dictionary more flexible.
namespace
{
template <ASTTableJoin::Kind KIND, ASTTableJoin::Strictness STRICTNESS, typename Map>
template <bool pad_left, ASTTableJoin::Strictness STRICTNESS, typename Map>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why the template parameter is named pad_left?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can understand, but It can be easily confused with PODArray padding.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fill_left will be more obvious.

M(SettingUInt64, max_rows_in_join, 0, "Maximum size of the hash table for JOIN (in number of rows).") \
M(SettingUInt64, max_bytes_in_join, 0, "Maximum size of the hash table for JOIN (in number of bytes in memory).") \
M(SettingOverflowMode<false>, join_overflow_mode, OverflowMode::THROW, "What to do when the limit is exceeded.") \
M(SettingBool, join_overwrite, false, "Whether to overwrite existing values when encountering the same key again.") \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's name it as any_join_take_last_row.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants