diff --git a/src/paimon/common/utils/binary_row_partition_computer_test.cpp b/src/paimon/common/utils/binary_row_partition_computer_test.cpp index 6a94e8bf..17028aae 100644 --- a/src/paimon/common/utils/binary_row_partition_computer_test.cpp +++ b/src/paimon/common/utils/binary_row_partition_computer_test.cpp @@ -297,7 +297,7 @@ TEST(BinaryRowPartitionComputerTest, TestPartToSimpleString) { arrow::field("f0", arrow::utf8()), arrow::field("f1", arrow::int32()), }); - auto partition = BinaryRowGenerator::GenerateRow({"20240731", 10}, pool.get()); + auto partition = BinaryRowGenerator::GenerateRow({std::string("20240731"), 10}, pool.get()); ASSERT_OK_AND_ASSIGN(std::string ret, BinaryRowPartitionComputer::PartToSimpleString( schema, partition, "-", 30)); ASSERT_EQ(ret, "20240731-10"); @@ -317,7 +317,7 @@ TEST(BinaryRowPartitionComputerTest, TestPartToSimpleString) { arrow::field("f0", arrow::utf8()), arrow::field("f1", arrow::int32()), }); - auto partition = BinaryRowGenerator::GenerateRow({"20240731", 10}, pool.get()); + auto partition = BinaryRowGenerator::GenerateRow({std::string("20240731"), 10}, pool.get()); ASSERT_OK_AND_ASSIGN(std::string ret, BinaryRowPartitionComputer::PartToSimpleString( schema, partition, "-", 5)); ASSERT_EQ(ret, "20240"); diff --git a/src/paimon/core/io/rolling_blob_file_writer_test.cpp b/src/paimon/core/io/rolling_blob_file_writer_test.cpp index a6cfdf7f..4a144eed 100644 --- a/src/paimon/core/io/rolling_blob_file_writer_test.cpp +++ b/src/paimon/core/io/rolling_blob_file_writer_test.cpp @@ -48,8 +48,8 @@ TEST_F(RollingBlobFileWriterTest, ValidateFileConsistency) { "data-xxx.xxx", /*file_size=*/405, /*row_count=*/4, /*min_key=*/BinaryRow::EmptyRow(), /*max_key=*/BinaryRow::EmptyRow(), /*key_stats=*/SimpleStats::EmptyStats(), - BinaryRowGenerator::GenerateStats({"str_0", 1}, {"str_3", 2}, std::vector({0, 2}), - pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("str_0"), 1}, {std::string("str_3"), 2}, + std::vector({0, 2}), pool_.get()), /*min_sequence_number=*/1, /*max_sequence_number=*/1, /*schema_id=*/0, /*level=*/0, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(1724090888706ll, 0), diff --git a/src/paimon/core/manifest/manifest_entry_writer_test.cpp b/src/paimon/core/manifest/manifest_entry_writer_test.cpp index 24f1b59b..fb691415 100644 --- a/src/paimon/core/manifest/manifest_entry_writer_test.cpp +++ b/src/paimon/core/manifest/manifest_entry_writer_test.cpp @@ -111,13 +111,15 @@ TEST_F(ManifestEntryWriterTest, TestSimple) { auto meta1 = std::make_shared( "data-d7725088-6bd4-4e70-9ce6-714ae93b47cc-0.orc", /*file_size=*/863, /*row_count=*/1, - /*min_key=*/BinaryRowGenerator::GenerateRow({"Alice", 1}, pool_.get()), - /*max_key=*/BinaryRowGenerator::GenerateRow({"Alice", 1}, pool_.get()), + /*min_key=*/BinaryRowGenerator::GenerateRow({std::string("Alice"), 1}, pool_.get()), + /*max_key=*/BinaryRowGenerator::GenerateRow({std::string("Alice"), 1}, pool_.get()), /*key_stats=*/ - BinaryRowGenerator::GenerateStats({"Alice", 1}, {"Alice", 1}, {0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Alice"), 1}, {std::string("Alice"), 1}, + {0, 0}, pool_.get()), /*value_stats=*/ - BinaryRowGenerator::GenerateStats({"Alice", 10, 1, 11.1}, {"Alice", 10, 1, 11.1}, - {0, 0, 0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Alice"), 10, 1, 11.1}, + {std::string("Alice"), 10, 1, 11.1}, {0, 0, 0, 0}, + pool_.get()), /*min_sequence_number=*/0, /*max_sequence_number=*/0, /*schema_id=*/0, /*level=*/4, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(1743525392885ll, 0), @@ -127,13 +129,15 @@ TEST_F(ManifestEntryWriterTest, TestSimple) { auto meta2 = std::make_shared( "data-5858a84b-7081-4618-b828-ae3918c5e1f6-0.orc", /*file_size=*/943, /*row_count=*/4, - /*min_key=*/BinaryRowGenerator::GenerateRow({"Alex", 0}, pool_.get()), - /*max_key=*/BinaryRowGenerator::GenerateRow({"Tony", 0}, pool_.get()), + /*min_key=*/BinaryRowGenerator::GenerateRow({std::string("Alex"), 0}, pool_.get()), + /*max_key=*/BinaryRowGenerator::GenerateRow({std::string("Tony"), 0}, pool_.get()), /*key_stats=*/ - BinaryRowGenerator::GenerateStats({"Alex", 0}, {"Tony", 0}, {0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Alex"), 0}, {std::string("Tony"), 0}, + {0, 0}, pool_.get()), /*value_stats=*/ - BinaryRowGenerator::GenerateStats({"Alex", 20, 0, 12.1}, {"Tony", 20, 0, 16.1}, - {0, 0, 0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Alex"), 20, 0, 12.1}, + {std::string("Tony"), 20, 0, 16.1}, {0, 0, 0, 0}, + pool_.get()), /*min_sequence_number=*/0, /*max_sequence_number=*/3, /*schema_id=*/0, /*level=*/5, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(1743525392921ll, 0), diff --git a/src/paimon/core/mergetree/lookup_file_test.cpp b/src/paimon/core/mergetree/lookup_file_test.cpp index b05b3789..2105aac8 100644 --- a/src/paimon/core/mergetree/lookup_file_test.cpp +++ b/src/paimon/core/mergetree/lookup_file_test.cpp @@ -91,7 +91,7 @@ TEST(LookupFileTest, TestLocalFilePrefix) { arrow::field("f0", arrow::utf8()), arrow::field("f1", arrow::int32()), }); - auto partition = BinaryRowGenerator::GenerateRow({"20240731", 10}, pool.get()); + auto partition = BinaryRowGenerator::GenerateRow({std::string("20240731"), 10}, pool.get()); ASSERT_OK_AND_ASSIGN(std::string ret, LookupFile::LocalFilePrefix( schema, partition, /*bucket=*/3, "test.orc")); ASSERT_EQ(ret, "20240731-10-3-test.orc"); diff --git a/src/paimon/core/operation/merge_file_split_read_test.cpp b/src/paimon/core/operation/merge_file_split_read_test.cpp index e5baf5e3..62579bc1 100644 --- a/src/paimon/core/operation/merge_file_split_read_test.cpp +++ b/src/paimon/core/operation/merge_file_split_read_test.cpp @@ -161,9 +161,10 @@ class MergeFileSplitReadTest : public ::testing::Test, /*key_stats=*/ BinaryRowGenerator::GenerateStats({100, 200}, {100, 200}, {0, 0}, pool_.get()), /*value_stats=*/ - BinaryRowGenerator::GenerateStats({100, 200, 0, 0, "max", "number", 140.4, false}, - {100, 200, 0, 0, "max", "number", 140.4, false}, - {0, 0, 0, 0, 0, 0, 0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats( + {100, 200, 0, 0, std::string("max"), std::string("number"), 140.4, false}, + {100, 200, 0, 0, std::string("max"), std::string("number"), 140.4, false}, + {0, 0, 0, 0, 0, 0, 0, 0}, pool_.get()), /*min_sequence_number=*/8, /*max_sequence_number=*/8, /*schema_id=*/0, /*level=*/0, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(1735230606999ll, 0), @@ -284,9 +285,9 @@ class MergeFileSplitReadTest : public ::testing::Test, /*max_key=*/BinaryRowGenerator::GenerateRow({1, 1}, pool_.get()), /*key_stats=*/BinaryRowGenerator::GenerateStats({0, 0}, {1, 1}, {0, 0}, pool_.get()), /*value_stats=*/ - BinaryRowGenerator::GenerateStats({0, 0, 2.0, false, "apple"}, - {1, 1, 2.0, true, "banana"}, {0, 0, 2, 0, 1}, - pool_.get()), + BinaryRowGenerator::GenerateStats({0, 0, 2.0, false, std::string("apple")}, + {1, 1, 2.0, true, std::string("banana")}, + {0, 0, 2, 0, 1}, pool_.get()), /*min_sequence_number=*/0, /*max_sequence_number=*/2, /*schema_id=*/0, /*level=*/0, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(1736793059256ll, 0), @@ -302,9 +303,9 @@ class MergeFileSplitReadTest : public ::testing::Test, /*max_key=*/BinaryRowGenerator::GenerateRow({2, 2}, pool_.get()), /*key_stats=*/BinaryRowGenerator::GenerateStats({0, 0}, {2, 2}, {0, 0}, pool_.get()), /*value_stats=*/ - BinaryRowGenerator::GenerateStats({0, 0, 100.0, false, "new_apple"}, - {2, 2, 144.4, true, "orange"}, {0, 0, 0, 0, 3}, - pool_.get()), + BinaryRowGenerator::GenerateStats({0, 0, 100.0, false, std::string("new_apple")}, + {2, 2, 144.4, true, std::string("orange")}, + {0, 0, 0, 0, 3}, pool_.get()), /*min_sequence_number=*/3, /*max_sequence_number=*/7, /*schema_id=*/0, /*level=*/0, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(1736793059526ll, 0), @@ -1173,13 +1174,15 @@ TEST_P(MergeFileSplitReadTest, Test09VersionWithoutInlineFieldId) { ASSERT_OK_AND_ASSIGN(std::shared_ptr read_context, context_builder.Finish()); auto meta1 = std::make_shared( "data-00e3ed53-16ba-4537-9264-b7dc03fefc65-0.orc", /*file_size=*/803, /*row_count=*/1, - /*min_key=*/BinaryRowGenerator::GenerateRow({"Tony", 0}, pool_.get()), - /*max_key=*/BinaryRowGenerator::GenerateRow({"Tony", 0}, pool_.get()), + /*min_key=*/BinaryRowGenerator::GenerateRow({std::string("Tony"), 0}, pool_.get()), + /*max_key=*/BinaryRowGenerator::GenerateRow({std::string("Tony"), 0}, pool_.get()), /*key_stats=*/ - BinaryRowGenerator::GenerateStats({"Tony", 0}, {"Tony", 0}, {0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Tony"), 0}, {std::string("Tony"), 0}, + {0, 0}, pool_.get()), /*value_stats=*/ - BinaryRowGenerator::GenerateStats({"Tony", 10, 0, 14.1}, {"Tony", 10, 0, 14.1}, - {0, 0, 0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Tony"), 10, 0, 14.1}, + {std::string("Tony"), 10, 0, 14.1}, {0, 0, 0, 0}, + pool_.get()), /*min_sequence_number=*/5, /*max_sequence_number=*/5, /*schema_id=*/0, /*level=*/0, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(0ll, 0), @@ -1189,13 +1192,15 @@ TEST_P(MergeFileSplitReadTest, Test09VersionWithoutInlineFieldId) { /*write_cols=*/std::nullopt); auto meta2 = std::make_shared( "data-6871b960-edd9-40fc-9859-aaca9ea205cf-0.orc", /*file_size=*/887, /*row_count=*/5, - /*min_key=*/BinaryRowGenerator::GenerateRow({"Alex", 0}, pool_.get()), - /*max_key=*/BinaryRowGenerator::GenerateRow({"Tony", 0}, pool_.get()), + /*min_key=*/BinaryRowGenerator::GenerateRow({std::string("Alex"), 0}, pool_.get()), + /*max_key=*/BinaryRowGenerator::GenerateRow({std::string("Tony"), 0}, pool_.get()), /*key_stats=*/ - BinaryRowGenerator::GenerateStats({"Alex", 0}, {"Tony", 0}, {0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Alex"), 0}, {std::string("Tony"), 0}, + {0, 0}, pool_.get()), /*value_stats=*/ - BinaryRowGenerator::GenerateStats({"Alex", 10, 0, 12.1}, {"Tony", 10, 0, 17.1}, - {0, 0, 0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Alex"), 10, 0, 12.1}, + {std::string("Tony"), 10, 0, 17.1}, {0, 0, 0, 0}, + pool_.get()), /*min_sequence_number=*/0, /*max_sequence_number=*/4, /*schema_id=*/0, /*level=*/0, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(0ll, 0), diff --git a/src/paimon/core/operation/raw_file_split_read_test.cpp b/src/paimon/core/operation/raw_file_split_read_test.cpp index e1b0b995..b0020151 100644 --- a/src/paimon/core/operation/raw_file_split_read_test.cpp +++ b/src/paimon/core/operation/raw_file_split_read_test.cpp @@ -55,8 +55,9 @@ class RawFileSplitReadTest : public ::testing::Test { "data-01b6a930-6564-409b-b8f4-ed1307790d72-0.orc", /*file_size=*/575, /*row_count=*/3, /*min_key=*/BinaryRow::EmptyRow(), /*max_key=*/BinaryRow::EmptyRow(), /*key_stats=*/SimpleStats::EmptyStats(), - BinaryRowGenerator::GenerateStats({"Bob", 10, 0, 12.1}, {"Tony", 10, 0, 14.1}, - {0, 0, 0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Bob"), 10, 0, 12.1}, + {std::string("Tony"), 10, 0, 14.1}, {0, 0, 0, 0}, + pool_.get()), /*min_sequence_number=*/0, /*max_sequence_number=*/2, /*schema_id=*/0, /*level=*/0, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(1728497439433ll, 0), @@ -78,8 +79,9 @@ class RawFileSplitReadTest : public ::testing::Test { "data-b79de94d-abe4-47d6-8e6c-911816487252-0.orc", /*file_size=*/541, /*row_count=*/1, /*min_key=*/BinaryRow::EmptyRow(), /*max_key=*/BinaryRow::EmptyRow(), /*key_stats=*/SimpleStats::EmptyStats(), - BinaryRowGenerator::GenerateStats({"Lucy", 20, 1, 14.1}, {"Lucy", 20, 1, 14.1}, - {0, 0, 0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Lucy"), 20, 1, 14.1}, + {std::string("Lucy"), 20, 1, 14.1}, {0, 0, 0, 0}, + pool_.get()), /*min_sequence_number=*/0, /*max_sequence_number=*/0, /*schema_id=*/0, /*level=*/0, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(1728497439453ll, 0), @@ -101,8 +103,9 @@ class RawFileSplitReadTest : public ::testing::Test { "data-955cbedd-ffcc-4234-8b98-4c3f08f78309-0.orc", /*file_size=*/543, /*row_count=*/1, /*min_key=*/BinaryRow::EmptyRow(), /*max_key=*/BinaryRow::EmptyRow(), /*key_stats=*/SimpleStats::EmptyStats(), - BinaryRowGenerator::GenerateStats({"Alice", 10, 1, 11.1}, {"Alice", 10, 1, 11.1}, - {0, 0, 0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Alice"), 10, 1, 11.1}, + {std::string("Alice"), 10, 1, 11.1}, {0, 0, 0, 0}, + pool_.get()), /*min_sequence_number=*/0, /*max_sequence_number=*/0, /*schema_id=*/0, /*level=*/0, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(1728497439469ll, 0), @@ -437,13 +440,15 @@ TEST_F(RawFileSplitReadTest, TestMatch) { bool raw_convertible) -> std::shared_ptr { auto meta = std::make_shared( "data-d7725088-6bd4-4e70-9ce6-714ae93b47cc-0.orc", /*file_size=*/863, /*row_count=*/1, - /*min_key=*/BinaryRowGenerator::GenerateRow({"Alice", 1}, pool_.get()), - /*max_key=*/BinaryRowGenerator::GenerateRow({"Alice", 1}, pool_.get()), + /*min_key=*/BinaryRowGenerator::GenerateRow({std::string("Alice"), 1}, pool_.get()), + /*max_key=*/BinaryRowGenerator::GenerateRow({std::string("Alice"), 1}, pool_.get()), /*key_stats=*/ - BinaryRowGenerator::GenerateStats({"Alice", 1}, {"Alice", 1}, {0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Alice"), 1}, {std::string("Alice"), 1}, + {0, 0}, pool_.get()), /*value_stats=*/ - BinaryRowGenerator::GenerateStats({"Alice", 10, 1, 11.1}, {"Alice", 10, 1, 11.1}, - {0, 0, 0, 0}, pool_.get()), + BinaryRowGenerator::GenerateStats({std::string("Alice"), 10, 1, 11.1}, + {std::string("Alice"), 10, 1, 11.1}, {0, 0, 0, 0}, + pool_.get()), /*min_sequence_number=*/0, /*max_sequence_number=*/0, /*schema_id=*/0, /*level=*/0, /*extra_files=*/std::vector>(), /*creation_time=*/Timestamp(1743525392885ll, 0),