diff --git a/be/src/storage/segment/encoding_info.cpp b/be/src/storage/segment/encoding_info.cpp index d2b9d99f114e85..85d01bf1e0ce09 100644 --- a/be/src/storage/segment/encoding_info.cpp +++ b/be/src/storage/segment/encoding_info.cpp @@ -386,8 +386,8 @@ EncodingInfoResolver::EncodingInfoResolver() { _set_v3_default(); _set_v3_default(); _set_v3_default(); - _set_v3_default(); - _set_v3_default(); + _set_v3_default(); + _set_v3_default(); _set_v3_default(); _set_v3_default(); _set_v3_default(); diff --git a/be/test/storage/segment/encoding_info_test.cpp b/be/test/storage/segment/encoding_info_test.cpp index 6a3b6e76e3258f..d32c72e4200836 100644 --- a/be/test/storage/segment/encoding_info_test.cpp +++ b/be/test/storage/segment/encoding_info_test.cpp @@ -91,10 +91,15 @@ TEST_F(EncodingInfoTest, v2_vs_v3_defaults) { check_split(FieldType::OLAP_FIELD_TYPE_QUANTILE_STATE, "QUANTILE_STATE"); check_split(FieldType::OLAP_FIELD_TYPE_AGG_STATE, "AGG_STATE"); - // Signed integers: V2=BIT_SHUFFLE, V3=PLAIN. + // Signed integers and floating-point types: V2=BIT_SHUFFLE, V3=PLAIN. + auto check_plain_v3 = [](FieldType type, const std::string& name) { + EXPECT_EQ(BIT_SHUFFLE, get_v2_default_encoding(type)) << name << " v2 default"; + EXPECT_EQ(PLAIN_ENCODING, get_v3_default_encoding(type)) << name << " v3 default"; + }; constexpr FieldType bigint_type = FieldType::OLAP_FIELD_TYPE_BIGINT; - EXPECT_EQ(BIT_SHUFFLE, get_v2_default_encoding(bigint_type)); - EXPECT_EQ(PLAIN_ENCODING, get_v3_default_encoding(bigint_type)); + check_plain_v3(bigint_type, "BIGINT"); + check_plain_v3(FieldType::OLAP_FIELD_TYPE_FLOAT, "FLOAT"); + check_plain_v3(FieldType::OLAP_FIELD_TYPE_DOUBLE, "DOUBLE"); // Value-seek default is only registered for VARCHAR (the only production caller). EXPECT_EQ(PREFIX_ENCODING, @@ -345,9 +350,10 @@ struct EncodingMapEntry { const char* name; }; -// Expected V3 default per type. Differs from V2 default in two type families: -// - binary blobs (HLL/BITMAP/QUANTILE_STATE/AGG_STATE): PLAIN_ENCODING_V2 (vs V2's PLAIN) +// Expected V3 default per type. Differs from V2 default in three type families: +// - binary blobs (HLL/BITMAP/QUANTILE_STATE/AGG_STATE): PLAIN_ENCODING_V3 (vs V2's PLAIN) // - signed integers (TINYINT..LARGEINT): PLAIN_ENCODING (vs V2's BIT_SHUFFLE) +// - floating-point types (FLOAT/DOUBLE): PLAIN_ENCODING (vs V2's BIT_SHUFFLE) const std::vector kV3DefaultExpect = { {FieldType::OLAP_FIELD_TYPE_TINYINT, PLAIN_ENCODING, "TINYINT"}, {FieldType::OLAP_FIELD_TYPE_SMALLINT, PLAIN_ENCODING, "SMALLINT"}, @@ -356,8 +362,8 @@ const std::vector kV3DefaultExpect = { {FieldType::OLAP_FIELD_TYPE_LARGEINT, PLAIN_ENCODING, "LARGEINT"}, {FieldType::OLAP_FIELD_TYPE_UNSIGNED_BIGINT, BIT_SHUFFLE, "UNSIGNED_BIGINT"}, {FieldType::OLAP_FIELD_TYPE_UNSIGNED_INT, BIT_SHUFFLE, "UNSIGNED_INT"}, - {FieldType::OLAP_FIELD_TYPE_FLOAT, BIT_SHUFFLE, "FLOAT"}, - {FieldType::OLAP_FIELD_TYPE_DOUBLE, BIT_SHUFFLE, "DOUBLE"}, + {FieldType::OLAP_FIELD_TYPE_FLOAT, PLAIN_ENCODING, "FLOAT"}, + {FieldType::OLAP_FIELD_TYPE_DOUBLE, PLAIN_ENCODING, "DOUBLE"}, {FieldType::OLAP_FIELD_TYPE_CHAR, DICT_ENCODING, "CHAR"}, {FieldType::OLAP_FIELD_TYPE_VARCHAR, DICT_ENCODING, "VARCHAR"}, {FieldType::OLAP_FIELD_TYPE_STRING, DICT_ENCODING, "STRING"}, diff --git a/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_not_nullable_without_bloom_vertical/segment_0.dat b/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_not_nullable_without_bloom_vertical/segment_0.dat index 3b5529606419bf..493a0bad583d5d 100644 Binary files a/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_not_nullable_without_bloom_vertical/segment_0.dat and b/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_not_nullable_without_bloom_vertical/segment_0.dat differ diff --git a/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_not_nullable_without_bloom_vertical/segment_1.dat b/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_not_nullable_without_bloom_vertical/segment_1.dat index 88ab18cdf7fd3c..edcd401c259eea 100644 Binary files a/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_not_nullable_without_bloom_vertical/segment_1.dat and b/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_not_nullable_without_bloom_vertical/segment_1.dat differ diff --git a/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_nullable_with_bloom_horizontal/segment_0.dat b/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_nullable_with_bloom_horizontal/segment_0.dat index 101e4969349139..4fa704f79cb791 100644 Binary files a/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_nullable_with_bloom_horizontal/segment_0.dat and b/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_nullable_with_bloom_horizontal/segment_0.dat differ diff --git a/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_nullable_with_bloom_horizontal/segment_1.dat b/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_nullable_with_bloom_horizontal/segment_1.dat index ada6c601fef94d..ef87c6f1273b91 100644 Binary files a/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_nullable_with_bloom_horizontal/segment_1.dat and b/be/test/storage/test_data/segment_flusher_format/all_scalar_values_v3_nullable_with_bloom_horizontal/segment_1.dat differ diff --git a/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_with_variant_bloom_vertical_compressed/segment_0.dat b/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_with_variant_bloom_vertical_compressed/segment_0.dat index b607d5d4309fa0..151025699d90bc 100644 Binary files a/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_with_variant_bloom_vertical_compressed/segment_0.dat and b/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_with_variant_bloom_vertical_compressed/segment_0.dat differ diff --git a/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_with_variant_bloom_vertical_compressed/segment_1.dat b/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_with_variant_bloom_vertical_compressed/segment_1.dat index f8b08ffaed0127..db4be9934a784e 100644 Binary files a/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_with_variant_bloom_vertical_compressed/segment_1.dat and b/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_with_variant_bloom_vertical_compressed/segment_1.dat differ diff --git a/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_without_variant_bloom_vertical_uncompressed/segment_0.dat b/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_without_variant_bloom_vertical_uncompressed/segment_0.dat index 3a201138c91372..f180609ba788ad 100644 Binary files a/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_without_variant_bloom_vertical_uncompressed/segment_0.dat and b/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_without_variant_bloom_vertical_uncompressed/segment_0.dat differ diff --git a/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_without_variant_bloom_vertical_uncompressed/segment_1.dat b/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_without_variant_bloom_vertical_uncompressed/segment_1.dat index 4223b2b44c02a9..f396653185ce8e 100644 Binary files a/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_without_variant_bloom_vertical_uncompressed/segment_1.dat and b/be/test/storage/test_data/segment_flusher_format/complex_v3_not_nullable_without_variant_bloom_vertical_uncompressed/segment_1.dat differ diff --git a/be/test/storage/test_data/segment_flusher_format/complex_v3_nullable_with_variant_bloom_horizontal_compressed/segment_0.dat b/be/test/storage/test_data/segment_flusher_format/complex_v3_nullable_with_variant_bloom_horizontal_compressed/segment_0.dat index d472a56a9d43d0..ee745aa9bd705c 100644 Binary files a/be/test/storage/test_data/segment_flusher_format/complex_v3_nullable_with_variant_bloom_horizontal_compressed/segment_0.dat and b/be/test/storage/test_data/segment_flusher_format/complex_v3_nullable_with_variant_bloom_horizontal_compressed/segment_0.dat differ diff --git a/be/test/storage/test_data/segment_flusher_format/complex_v3_nullable_without_variant_bloom_horizontal_uncompressed/segment_0.dat b/be/test/storage/test_data/segment_flusher_format/complex_v3_nullable_without_variant_bloom_horizontal_uncompressed/segment_0.dat index db20be8790f7ab..d7c8fcb0a5ef07 100644 Binary files a/be/test/storage/test_data/segment_flusher_format/complex_v3_nullable_without_variant_bloom_horizontal_uncompressed/segment_0.dat and b/be/test/storage/test_data/segment_flusher_format/complex_v3_nullable_without_variant_bloom_horizontal_uncompressed/segment_0.dat differ