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

checksum: do not check inverted index files #47607

Merged
merged 2 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Storages/MergeTree/MergeTreeDataPartChecksum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ void MergeTreeDataPartChecksum::checkEqual(const MergeTreeDataPartChecksum & rhs

void MergeTreeDataPartChecksum::checkSize(const IDataPartStorage & storage, const String & name) const
{
/// Skip inverted index files, these have a default MergeTreeDataPartChecksum with file_size == 0
if (name.ends_with(".gin_dict") || name.ends_with(".gin_post") || name.ends_with(".gin_seg") || name.ends_with(".gin_sid"))
return;

if (!storage.exists(name))
throw Exception(ErrorCodes::FILE_DOESNT_EXIST, "{} doesn't exist", fs::path(storage.getRelativePath()) / name);

Expand Down
Empty file.
16 changes: 16 additions & 0 deletions tests/queries/0_stateless/25341_inverted_idx_checksums.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SET allow_experimental_inverted_index = 1;

CREATE TABLE t
(
`key` UInt64,
`str` String,
INDEX inv_idx str TYPE inverted(0) GRANULARITY 1
)
ENGINE = MergeTree
ORDER BY key;

INSERT INTO t VALUES (1, 'Hello World');

ALTER TABLE t DETACH PART 'all_1_1_0';

ALTER TABLE t ATTACH PART 'all_1_1_0';