Skip to content
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

Clickhouse SetupNormalize: changes to table definition #2008

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Amogh-Bharadwaj
Copy link
Contributor

@Amogh-Bharadwaj Amogh-Bharadwaj commented Aug 26, 2024

This PR:

  • Includes the peerdb_is_deleted column as a parameter of the ReplacingMergeTree engine
  • Changes the variable name from signColName/Type to isDeletedColName/Type. Pretty sure signCol is for collapsing merge tree contexts.
  • Changes the type of the peerdb_is_deleted column to UInt*, as that is needed to include it as param. Changed version column type to UInt64 from Int64, as it is always a positive value

Old definition:

CREATE TABLE default.public_test_table
(
    `id` Int32,
    `n` Decimal(10, 0),
    `_peerdb_synced_at` DateTime64(9) DEFAULT now(),
    `_peerdb_is_deleted` Int8,
    `_peerdb_version` Int64
)
ENGINE = ReplacingMergeTree(_peerdb_version)
PRIMARY KEY id
ORDER BY id
SETTINGS index_granularity = 8192

New definition:

CREATE TABLE default.public_test_table_new_definition
(
    `id` Int32,
    `_peerdb_synced_at` DateTime64(9) DEFAULT now64(),
    `_peerdb_is_deleted` UInt8,
    `_peerdb_version` UInt64
)
ENGINE = ReplacingMergeTree(_peerdb_version, _peerdb_is_deleted)
PRIMARY KEY id
ORDER BY id
SETTINGS index_granularity = 8192
  • Functionally tested

@Amogh-Bharadwaj Amogh-Bharadwaj changed the title Clickhouse SetupNormalize: Include version and is_deleted as params Clickhouse SetupNormalize: Include is_deleted as param of table engine Aug 26, 2024
@Amogh-Bharadwaj Amogh-Bharadwaj changed the title Clickhouse SetupNormalize: Include is_deleted as param of table engine Clickhouse SetupNormalize: changes to table definition Aug 26, 2024
@Amogh-Bharadwaj Amogh-Bharadwaj marked this pull request as ready for review August 29, 2024 19:57
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