diff --git a/src/Storages/MergeTree/GinIndexStore.cpp b/src/Storages/MergeTree/GinIndexStore.cpp index 72d01733a1d..a568810c211 100644 --- a/src/Storages/MergeTree/GinIndexStore.cpp +++ b/src/Storages/MergeTree/GinIndexStore.cpp @@ -225,7 +225,7 @@ UInt32 GinIndexStore::getNumOfSegments() uint8_t version = 0; readBinary(version, *istr); - if (version > CURRENT_GIN_FILE_FORMAT_VERSION) + if (version > static_cast>(CURRENT_GIN_FILE_FORMAT_VERSION)) throw Exception(ErrorCodes::UNKNOWN_FORMAT_VERSION, "Unsupported inverted index version {}", version); readVarUInt(result, *istr); diff --git a/src/Storages/MergeTree/GinIndexStore.h b/src/Storages/MergeTree/GinIndexStore.h index b31601dad5e..6f6b92e686e 100644 --- a/src/Storages/MergeTree/GinIndexStore.h +++ b/src/Storages/MergeTree/GinIndexStore.h @@ -34,13 +34,6 @@ namespace DB { -enum : uint8_t -{ - GIN_VERSION_0 = 0, - GIN_VERSION_1 = 1, /// Initial version -}; - -static constexpr auto CURRENT_GIN_FILE_FORMAT_VERSION = GIN_VERSION_1; /// GinIndexPostingsList which uses 32-bit Roaring using GinIndexPostingsList = roaring::Roaring; @@ -217,6 +210,14 @@ private: static constexpr auto GIN_SEGMENT_FILE_TYPE = ".gin_seg"; static constexpr auto GIN_DICTIONARY_FILE_TYPE = ".gin_dict"; static constexpr auto GIN_POSTINGS_FILE_TYPE = ".gin_post"; + + enum class Format : uint8_t + { + v0 = 0, + v1 = 1, /// Initial version + }; + + static constexpr auto CURRENT_GIN_FILE_FORMAT_VERSION = Format::v0; }; using GinIndexStorePtr = std::shared_ptr;