Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/paimon/core/io/rolling_blob_file_writer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t>({0, 2}),
pool_.get()),
BinaryRowGenerator::GenerateStats({std::string("str_0"), 1}, {std::string("str_3"), 2},
std::vector<int64_t>({0, 2}), pool_.get()),
/*min_sequence_number=*/1, /*max_sequence_number=*/1, /*schema_id=*/0,
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1724090888706ll, 0),
Expand Down
24 changes: 14 additions & 10 deletions src/paimon/core/manifest/manifest_entry_writer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@ TEST_F(ManifestEntryWriterTest, TestSimple) {

auto meta1 = std::make_shared<DataFileMeta>(
"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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1743525392885ll, 0),
Expand All @@ -127,13 +129,15 @@ TEST_F(ManifestEntryWriterTest, TestSimple) {

auto meta2 = std::make_shared<DataFileMeta>(
"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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1743525392921ll, 0),
Expand Down
2 changes: 1 addition & 1 deletion src/paimon/core/mergetree/lookup_file_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
43 changes: 24 additions & 19 deletions src/paimon/core/operation/merge_file_split_read_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1735230606999ll, 0),
Expand Down Expand Up @@ -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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1736793059256ll, 0),
Expand All @@ -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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1736793059526ll, 0),
Expand Down Expand Up @@ -1173,13 +1174,15 @@ TEST_P(MergeFileSplitReadTest, Test09VersionWithoutInlineFieldId) {
ASSERT_OK_AND_ASSIGN(std::shared_ptr<ReadContext> read_context, context_builder.Finish());
auto meta1 = std::make_shared<DataFileMeta>(
"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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(0ll, 0),
Expand All @@ -1189,13 +1192,15 @@ TEST_P(MergeFileSplitReadTest, Test09VersionWithoutInlineFieldId) {
/*write_cols=*/std::nullopt);
auto meta2 = std::make_shared<DataFileMeta>(
"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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(0ll, 0),
Expand Down
27 changes: 16 additions & 11 deletions src/paimon/core/operation/raw_file_split_read_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1728497439433ll, 0),
Expand All @@ -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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1728497439453ll, 0),
Expand All @@ -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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1728497439469ll, 0),
Expand Down Expand Up @@ -437,13 +440,15 @@ TEST_F(RawFileSplitReadTest, TestMatch) {
bool raw_convertible) -> std::shared_ptr<DataSplit> {
auto meta = std::make_shared<DataFileMeta>(
"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<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1743525392885ll, 0),
Expand Down
Loading