Merge pull request #47607 from save-my-heart/inverted_index

checksum: do not check inverted index files
This commit is contained in:
Robert Schulze 2023-03-16 21:34:17 +01:00 committed by GitHub
commit 02a2c73bae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View File

@ -46,6 +46,10 @@ void MergeTreeDataPartChecksum::checkEqual(const MergeTreeDataPartChecksum & rhs
void MergeTreeDataPartChecksum::checkSize(const IDataPartStorage & storage, const String & name) const 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)) if (!storage.exists(name))
throw Exception(ErrorCodes::FILE_DOESNT_EXIST, "{} doesn't exist", fs::path(storage.getRelativePath()) / name); throw Exception(ErrorCodes::FILE_DOESNT_EXIST, "{} doesn't exist", fs::path(storage.getRelativePath()) / name);

View File

@ -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';