Skip to content

Commit 91dc60a

Browse files
committed
update statistics format version to avoid incompability
1 parent 8b2f7f5 commit 91dc60a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Storages/Statistics/Statistics.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ namespace ErrorCodes
3838
enum StatisticsFileVersion : UInt16
3939
{
4040
V0 = 0,
41+
V1 = 1, /// modify the format of uniq, https://github.com/ClickHouse/ClickHouse/pull/90311
4142
};
4243

4344
std::optional<Float64> StatisticsUtils::tryConvertToFloat64(const Field & value, const DataTypePtr & data_type)
@@ -231,7 +232,7 @@ Estimate ColumnStatistics::getEstimate() const
231232

232233
void ColumnStatistics::serialize(WriteBuffer & buf)
233234
{
234-
writeIntBinary(V0, buf);
235+
writeIntBinary(V1, buf);
235236

236237
UInt64 stat_types_mask = 0;
237238
for (const auto & [type, _]: stats)
@@ -250,7 +251,7 @@ void ColumnStatistics::deserialize(ReadBuffer &buf)
250251
{
251252
UInt16 version;
252253
readIntBinary(version, buf);
253-
if (version != V0)
254+
if (version != V1)
254255
throw Exception(ErrorCodes::CORRUPTED_DATA, "Unknown file format version: {}", version);
255256

256257
UInt64 stat_types_mask = 0;

0 commit comments

Comments
 (0)