mapleFU commented on code in PR #36377:
URL: https://github.com/apache/arrow/pull/36377#discussion_r1268187930
##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -5057,23 +5092,123 @@ class TestBufferedParquetIO : public
TestParquetIO<TestType> {
TYPED_TEST_SUITE(TestBufferedParquetIO, TestTypes);
TYPED_TEST(TestBufferedParquetIO, SingleColumnOptionalBufferedWriteSmall) {
- constexpr int64_t batch_size = SMALL_SIZE / 4;
+ constexpr size_t NUM_BATCHES = 4;
+ constexpr int64_t batch_size = SMALL_SIZE / NUM_BATCHES;
std::shared_ptr<Array> values;
- ASSERT_OK(NullableArray<TypeParam>(SMALL_SIZE, 10, kDefaultSeed, &values));
+ ASSERT_OK(
+ NullableArray<TypeParam>(SMALL_SIZE, /*num_nulls=*/10, kDefaultSeed,
&values));
int num_row_groups = 0;
this->WriteBufferedFile(values, batch_size, &num_row_groups);
ASSERT_NO_FATAL_FAILURE(this->ReadAndCheckSingleColumnFile(*values,
num_row_groups));
}
TYPED_TEST(TestBufferedParquetIO, SingleColumnOptionalBufferedWriteLarge) {
- constexpr int64_t batch_size = LARGE_SIZE / 4;
+ constexpr size_t NUM_BATCHES = 4;
+ constexpr int64_t batch_size = LARGE_SIZE / NUM_BATCHES;
std::shared_ptr<Array> values;
- ASSERT_OK(NullableArray<TypeParam>(LARGE_SIZE, 100, kDefaultSeed, &values));
+ ASSERT_OK(
+ NullableArray<TypeParam>(LARGE_SIZE, /*num_nulls=*/100, kDefaultSeed,
&values));
int num_row_groups = 0;
this->WriteBufferedFile(values, batch_size, &num_row_groups);
ASSERT_NO_FATAL_FAILURE(this->ReadAndCheckSingleColumnTable(values,
num_row_groups));
}
+TYPED_TEST(TestBufferedParquetIO, WriteTableSmall) {
+ std::shared_ptr<Array> values;
+ ASSERT_OK(
+ NullableArray<TypeParam>(SMALL_SIZE, /*num_nulls=*/10, kDefaultSeed,
&values));
+ int num_row_groups = 0;
+ // Write all table with one batch.
+ int64_t write_table_batch_size = SMALL_SIZE;
+ int64_t write_table_max_row_group_size = DEFAULT_MAX_ROW_GROUP_LENGTH;
+ int64_t write_max_row_group_size = DEFAULT_MAX_ROW_GROUP_LENGTH;
+ this->WriteBufferedTable(values, write_table_batch_size,
write_table_max_row_group_size,
+ write_max_row_group_size, &num_row_groups);
+ EXPECT_EQ(1, num_row_groups);
+ ASSERT_NO_FATAL_FAILURE(this->ReadAndCheckSingleColumnFile(*values,
num_row_groups));
Review Comment:
No. I'll add it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]