Skip to content

Commit bafead5

Browse files
committed
fix(ut): fix more binary row init under gcc8
1 parent 5707ef9 commit bafead5

File tree

6 files changed

+59
-45
lines changed

6 files changed

+59
-45
lines changed

src/paimon/common/utils/binary_row_partition_computer_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ TEST(BinaryRowPartitionComputerTest, TestPartToSimpleString) {
297297
arrow::field("f0", arrow::utf8()),
298298
arrow::field("f1", arrow::int32()),
299299
});
300-
auto partition = BinaryRowGenerator::GenerateRow({"20240731", 10}, pool.get());
300+
auto partition = BinaryRowGenerator::GenerateRow({std::string("20240731"), 10}, pool.get());
301301
ASSERT_OK_AND_ASSIGN(std::string ret, BinaryRowPartitionComputer::PartToSimpleString(
302302
schema, partition, "-", 30));
303303
ASSERT_EQ(ret, "20240731-10");
@@ -317,7 +317,7 @@ TEST(BinaryRowPartitionComputerTest, TestPartToSimpleString) {
317317
arrow::field("f0", arrow::utf8()),
318318
arrow::field("f1", arrow::int32()),
319319
});
320-
auto partition = BinaryRowGenerator::GenerateRow({"20240731", 10}, pool.get());
320+
auto partition = BinaryRowGenerator::GenerateRow({std::string("20240731"), 10}, pool.get());
321321
ASSERT_OK_AND_ASSIGN(std::string ret, BinaryRowPartitionComputer::PartToSimpleString(
322322
schema, partition, "-", 5));
323323
ASSERT_EQ(ret, "20240");

src/paimon/core/io/rolling_blob_file_writer_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ TEST_F(RollingBlobFileWriterTest, ValidateFileConsistency) {
4848
"data-xxx.xxx", /*file_size=*/405, /*row_count=*/4,
4949
/*min_key=*/BinaryRow::EmptyRow(), /*max_key=*/BinaryRow::EmptyRow(),
5050
/*key_stats=*/SimpleStats::EmptyStats(),
51-
BinaryRowGenerator::GenerateStats({"str_0", 1}, {"str_3", 2}, std::vector<int64_t>({0, 2}),
52-
pool_.get()),
51+
BinaryRowGenerator::GenerateStats({std::string("str_0"), 1}, {std::string("str_3"), 2},
52+
std::vector<int64_t>({0, 2}), pool_.get()),
5353
/*min_sequence_number=*/1, /*max_sequence_number=*/1, /*schema_id=*/0,
5454
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
5555
/*creation_time=*/Timestamp(1724090888706ll, 0),

src/paimon/core/manifest/manifest_entry_writer_test.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,15 @@ TEST_F(ManifestEntryWriterTest, TestSimple) {
111111

112112
auto meta1 = std::make_shared<DataFileMeta>(
113113
"data-d7725088-6bd4-4e70-9ce6-714ae93b47cc-0.orc", /*file_size=*/863, /*row_count=*/1,
114-
/*min_key=*/BinaryRowGenerator::GenerateRow({"Alice", 1}, pool_.get()),
115-
/*max_key=*/BinaryRowGenerator::GenerateRow({"Alice", 1}, pool_.get()),
114+
/*min_key=*/BinaryRowGenerator::GenerateRow({std::string("Alice"), 1}, pool_.get()),
115+
/*max_key=*/BinaryRowGenerator::GenerateRow({std::string("Alice"), 1}, pool_.get()),
116116
/*key_stats=*/
117-
BinaryRowGenerator::GenerateStats({"Alice", 1}, {"Alice", 1}, {0, 0}, pool_.get()),
117+
BinaryRowGenerator::GenerateStats({std::string("Alice"), 1}, {std::string("Alice"), 1},
118+
{0, 0}, pool_.get()),
118119
/*value_stats=*/
119-
BinaryRowGenerator::GenerateStats({"Alice", 10, 1, 11.1}, {"Alice", 10, 1, 11.1},
120-
{0, 0, 0, 0}, pool_.get()),
120+
BinaryRowGenerator::GenerateStats({std::string("Alice"), 10, 1, 11.1},
121+
{std::string("Alice"), 10, 1, 11.1}, {0, 0, 0, 0},
122+
pool_.get()),
121123
/*min_sequence_number=*/0, /*max_sequence_number=*/0, /*schema_id=*/0,
122124
/*level=*/4, /*extra_files=*/std::vector<std::optional<std::string>>(),
123125
/*creation_time=*/Timestamp(1743525392885ll, 0),
@@ -127,13 +129,15 @@ TEST_F(ManifestEntryWriterTest, TestSimple) {
127129

128130
auto meta2 = std::make_shared<DataFileMeta>(
129131
"data-5858a84b-7081-4618-b828-ae3918c5e1f6-0.orc", /*file_size=*/943, /*row_count=*/4,
130-
/*min_key=*/BinaryRowGenerator::GenerateRow({"Alex", 0}, pool_.get()),
131-
/*max_key=*/BinaryRowGenerator::GenerateRow({"Tony", 0}, pool_.get()),
132+
/*min_key=*/BinaryRowGenerator::GenerateRow({std::string("Alex"), 0}, pool_.get()),
133+
/*max_key=*/BinaryRowGenerator::GenerateRow({std::string("Tony"), 0}, pool_.get()),
132134
/*key_stats=*/
133-
BinaryRowGenerator::GenerateStats({"Alex", 0}, {"Tony", 0}, {0, 0}, pool_.get()),
135+
BinaryRowGenerator::GenerateStats({std::string("Alex"), 0}, {std::string("Tony"), 0},
136+
{0, 0}, pool_.get()),
134137
/*value_stats=*/
135-
BinaryRowGenerator::GenerateStats({"Alex", 20, 0, 12.1}, {"Tony", 20, 0, 16.1},
136-
{0, 0, 0, 0}, pool_.get()),
138+
BinaryRowGenerator::GenerateStats({std::string("Alex"), 20, 0, 12.1},
139+
{std::string("Tony"), 20, 0, 16.1}, {0, 0, 0, 0},
140+
pool_.get()),
137141
/*min_sequence_number=*/0, /*max_sequence_number=*/3, /*schema_id=*/0,
138142
/*level=*/5, /*extra_files=*/std::vector<std::optional<std::string>>(),
139143
/*creation_time=*/Timestamp(1743525392921ll, 0),

src/paimon/core/mergetree/lookup_file_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ TEST(LookupFileTest, TestLocalFilePrefix) {
9191
arrow::field("f0", arrow::utf8()),
9292
arrow::field("f1", arrow::int32()),
9393
});
94-
auto partition = BinaryRowGenerator::GenerateRow({"20240731", 10}, pool.get());
94+
auto partition = BinaryRowGenerator::GenerateRow({std::string("20240731"), 10}, pool.get());
9595
ASSERT_OK_AND_ASSIGN(std::string ret, LookupFile::LocalFilePrefix(
9696
schema, partition, /*bucket=*/3, "test.orc"));
9797
ASSERT_EQ(ret, "20240731-10-3-test.orc");

src/paimon/core/operation/merge_file_split_read_test.cpp

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ class MergeFileSplitReadTest : public ::testing::Test,
161161
/*key_stats=*/
162162
BinaryRowGenerator::GenerateStats({100, 200}, {100, 200}, {0, 0}, pool_.get()),
163163
/*value_stats=*/
164-
BinaryRowGenerator::GenerateStats({100, 200, 0, 0, "max", "number", 140.4, false},
165-
{100, 200, 0, 0, "max", "number", 140.4, false},
166-
{0, 0, 0, 0, 0, 0, 0, 0}, pool_.get()),
164+
BinaryRowGenerator::GenerateStats(
165+
{100, 200, 0, 0, std::string("max"), std::string("number"), 140.4, false},
166+
{100, 200, 0, 0, std::string("max"), std::string("number"), 140.4, false},
167+
{0, 0, 0, 0, 0, 0, 0, 0}, pool_.get()),
167168
/*min_sequence_number=*/8, /*max_sequence_number=*/8, /*schema_id=*/0,
168169
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
169170
/*creation_time=*/Timestamp(1735230606999ll, 0),
@@ -284,9 +285,9 @@ class MergeFileSplitReadTest : public ::testing::Test,
284285
/*max_key=*/BinaryRowGenerator::GenerateRow({1, 1}, pool_.get()),
285286
/*key_stats=*/BinaryRowGenerator::GenerateStats({0, 0}, {1, 1}, {0, 0}, pool_.get()),
286287
/*value_stats=*/
287-
BinaryRowGenerator::GenerateStats({0, 0, 2.0, false, "apple"},
288-
{1, 1, 2.0, true, "banana"}, {0, 0, 2, 0, 1},
289-
pool_.get()),
288+
BinaryRowGenerator::GenerateStats({0, 0, 2.0, false, std::string("apple")},
289+
{1, 1, 2.0, true, std::string("banana")},
290+
{0, 0, 2, 0, 1}, pool_.get()),
290291
/*min_sequence_number=*/0, /*max_sequence_number=*/2, /*schema_id=*/0,
291292
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
292293
/*creation_time=*/Timestamp(1736793059256ll, 0),
@@ -302,9 +303,9 @@ class MergeFileSplitReadTest : public ::testing::Test,
302303
/*max_key=*/BinaryRowGenerator::GenerateRow({2, 2}, pool_.get()),
303304
/*key_stats=*/BinaryRowGenerator::GenerateStats({0, 0}, {2, 2}, {0, 0}, pool_.get()),
304305
/*value_stats=*/
305-
BinaryRowGenerator::GenerateStats({0, 0, 100.0, false, "new_apple"},
306-
{2, 2, 144.4, true, "orange"}, {0, 0, 0, 0, 3},
307-
pool_.get()),
306+
BinaryRowGenerator::GenerateStats({0, 0, 100.0, false, std::string("new_apple")},
307+
{2, 2, 144.4, true, std::string("orange")},
308+
{0, 0, 0, 0, 3}, pool_.get()),
308309
/*min_sequence_number=*/3, /*max_sequence_number=*/7, /*schema_id=*/0,
309310
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
310311
/*creation_time=*/Timestamp(1736793059526ll, 0),
@@ -1173,13 +1174,15 @@ TEST_P(MergeFileSplitReadTest, Test09VersionWithoutInlineFieldId) {
11731174
ASSERT_OK_AND_ASSIGN(std::shared_ptr<ReadContext> read_context, context_builder.Finish());
11741175
auto meta1 = std::make_shared<DataFileMeta>(
11751176
"data-00e3ed53-16ba-4537-9264-b7dc03fefc65-0.orc", /*file_size=*/803, /*row_count=*/1,
1176-
/*min_key=*/BinaryRowGenerator::GenerateRow({"Tony", 0}, pool_.get()),
1177-
/*max_key=*/BinaryRowGenerator::GenerateRow({"Tony", 0}, pool_.get()),
1177+
/*min_key=*/BinaryRowGenerator::GenerateRow({std::string("Tony"), 0}, pool_.get()),
1178+
/*max_key=*/BinaryRowGenerator::GenerateRow({std::string("Tony"), 0}, pool_.get()),
11781179
/*key_stats=*/
1179-
BinaryRowGenerator::GenerateStats({"Tony", 0}, {"Tony", 0}, {0, 0}, pool_.get()),
1180+
BinaryRowGenerator::GenerateStats({std::string("Tony"), 0}, {std::string("Tony"), 0},
1181+
{0, 0}, pool_.get()),
11801182
/*value_stats=*/
1181-
BinaryRowGenerator::GenerateStats({"Tony", 10, 0, 14.1}, {"Tony", 10, 0, 14.1},
1182-
{0, 0, 0, 0}, pool_.get()),
1183+
BinaryRowGenerator::GenerateStats({std::string("Tony"), 10, 0, 14.1},
1184+
{std::string("Tony"), 10, 0, 14.1}, {0, 0, 0, 0},
1185+
pool_.get()),
11831186
/*min_sequence_number=*/5, /*max_sequence_number=*/5, /*schema_id=*/0,
11841187
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
11851188
/*creation_time=*/Timestamp(0ll, 0),
@@ -1189,13 +1192,15 @@ TEST_P(MergeFileSplitReadTest, Test09VersionWithoutInlineFieldId) {
11891192
/*write_cols=*/std::nullopt);
11901193
auto meta2 = std::make_shared<DataFileMeta>(
11911194
"data-6871b960-edd9-40fc-9859-aaca9ea205cf-0.orc", /*file_size=*/887, /*row_count=*/5,
1192-
/*min_key=*/BinaryRowGenerator::GenerateRow({"Alex", 0}, pool_.get()),
1193-
/*max_key=*/BinaryRowGenerator::GenerateRow({"Tony", 0}, pool_.get()),
1195+
/*min_key=*/BinaryRowGenerator::GenerateRow({std::string("Alex"), 0}, pool_.get()),
1196+
/*max_key=*/BinaryRowGenerator::GenerateRow({std::string("Tony"), 0}, pool_.get()),
11941197
/*key_stats=*/
1195-
BinaryRowGenerator::GenerateStats({"Alex", 0}, {"Tony", 0}, {0, 0}, pool_.get()),
1198+
BinaryRowGenerator::GenerateStats({std::string("Alex"), 0}, {std::string("Tony"), 0},
1199+
{0, 0}, pool_.get()),
11961200
/*value_stats=*/
1197-
BinaryRowGenerator::GenerateStats({"Alex", 10, 0, 12.1}, {"Tony", 10, 0, 17.1},
1198-
{0, 0, 0, 0}, pool_.get()),
1201+
BinaryRowGenerator::GenerateStats({std::string("Alex"), 10, 0, 12.1},
1202+
{std::string("Tony"), 10, 0, 17.1}, {0, 0, 0, 0},
1203+
pool_.get()),
11991204
/*min_sequence_number=*/0, /*max_sequence_number=*/4, /*schema_id=*/0,
12001205
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
12011206
/*creation_time=*/Timestamp(0ll, 0),

src/paimon/core/operation/raw_file_split_read_test.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ class RawFileSplitReadTest : public ::testing::Test {
5555
"data-01b6a930-6564-409b-b8f4-ed1307790d72-0.orc", /*file_size=*/575, /*row_count=*/3,
5656
/*min_key=*/BinaryRow::EmptyRow(), /*max_key=*/BinaryRow::EmptyRow(),
5757
/*key_stats=*/SimpleStats::EmptyStats(),
58-
BinaryRowGenerator::GenerateStats({"Bob", 10, 0, 12.1}, {"Tony", 10, 0, 14.1},
59-
{0, 0, 0, 0}, pool_.get()),
58+
BinaryRowGenerator::GenerateStats({std::string("Bob"), 10, 0, 12.1},
59+
{std::string("Tony"), 10, 0, 14.1}, {0, 0, 0, 0},
60+
pool_.get()),
6061
/*min_sequence_number=*/0, /*max_sequence_number=*/2, /*schema_id=*/0,
6162
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
6263
/*creation_time=*/Timestamp(1728497439433ll, 0),
@@ -78,8 +79,9 @@ class RawFileSplitReadTest : public ::testing::Test {
7879
"data-b79de94d-abe4-47d6-8e6c-911816487252-0.orc", /*file_size=*/541, /*row_count=*/1,
7980
/*min_key=*/BinaryRow::EmptyRow(), /*max_key=*/BinaryRow::EmptyRow(),
8081
/*key_stats=*/SimpleStats::EmptyStats(),
81-
BinaryRowGenerator::GenerateStats({"Lucy", 20, 1, 14.1}, {"Lucy", 20, 1, 14.1},
82-
{0, 0, 0, 0}, pool_.get()),
82+
BinaryRowGenerator::GenerateStats({std::string("Lucy"), 20, 1, 14.1},
83+
{std::string("Lucy"), 20, 1, 14.1}, {0, 0, 0, 0},
84+
pool_.get()),
8385
/*min_sequence_number=*/0, /*max_sequence_number=*/0, /*schema_id=*/0,
8486
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
8587
/*creation_time=*/Timestamp(1728497439453ll, 0),
@@ -101,8 +103,9 @@ class RawFileSplitReadTest : public ::testing::Test {
101103
"data-955cbedd-ffcc-4234-8b98-4c3f08f78309-0.orc", /*file_size=*/543, /*row_count=*/1,
102104
/*min_key=*/BinaryRow::EmptyRow(), /*max_key=*/BinaryRow::EmptyRow(),
103105
/*key_stats=*/SimpleStats::EmptyStats(),
104-
BinaryRowGenerator::GenerateStats({"Alice", 10, 1, 11.1}, {"Alice", 10, 1, 11.1},
105-
{0, 0, 0, 0}, pool_.get()),
106+
BinaryRowGenerator::GenerateStats({std::string("Alice"), 10, 1, 11.1},
107+
{std::string("Alice"), 10, 1, 11.1}, {0, 0, 0, 0},
108+
pool_.get()),
106109
/*min_sequence_number=*/0, /*max_sequence_number=*/0, /*schema_id=*/0,
107110
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
108111
/*creation_time=*/Timestamp(1728497439469ll, 0),
@@ -437,13 +440,15 @@ TEST_F(RawFileSplitReadTest, TestMatch) {
437440
bool raw_convertible) -> std::shared_ptr<DataSplit> {
438441
auto meta = std::make_shared<DataFileMeta>(
439442
"data-d7725088-6bd4-4e70-9ce6-714ae93b47cc-0.orc", /*file_size=*/863, /*row_count=*/1,
440-
/*min_key=*/BinaryRowGenerator::GenerateRow({"Alice", 1}, pool_.get()),
441-
/*max_key=*/BinaryRowGenerator::GenerateRow({"Alice", 1}, pool_.get()),
443+
/*min_key=*/BinaryRowGenerator::GenerateRow({std::string("Alice"), 1}, pool_.get()),
444+
/*max_key=*/BinaryRowGenerator::GenerateRow({std::string("Alice"), 1}, pool_.get()),
442445
/*key_stats=*/
443-
BinaryRowGenerator::GenerateStats({"Alice", 1}, {"Alice", 1}, {0, 0}, pool_.get()),
446+
BinaryRowGenerator::GenerateStats({std::string("Alice"), 1}, {std::string("Alice"), 1},
447+
{0, 0}, pool_.get()),
444448
/*value_stats=*/
445-
BinaryRowGenerator::GenerateStats({"Alice", 10, 1, 11.1}, {"Alice", 10, 1, 11.1},
446-
{0, 0, 0, 0}, pool_.get()),
449+
BinaryRowGenerator::GenerateStats({std::string("Alice"), 10, 1, 11.1},
450+
{std::string("Alice"), 10, 1, 11.1}, {0, 0, 0, 0},
451+
pool_.get()),
447452
/*min_sequence_number=*/0, /*max_sequence_number=*/0, /*schema_id=*/0,
448453
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
449454
/*creation_time=*/Timestamp(1743525392885ll, 0),

0 commit comments

Comments
 (0)