pitrou commented on code in PR #39211:
URL: https://github.com/apache/arrow/pull/39211#discussion_r1425327739
##########
cpp/src/parquet/arrow/writer.cc:
##########
@@ -462,7 +462,8 @@ class FileWriterImpl : public FileWriter {
offset += batch_size;
// Flush current row group if it is full.
- if (row_group_writer_->num_rows() >= max_row_group_length) {
+ if (row_group_writer_->num_rows() >= max_row_group_length &&
+ offset < batch.num_rows()) {
Review Comment:
Why not avoid `WriteBatch` above instead?
##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -5224,6 +5224,45 @@ TEST(TestArrowReadWrite, WriteAndReadRecordBatch) {
EXPECT_TRUE(record_batch->Equals(*read_record_batch));
}
+TEST(TestArrowReadWrite, WriteRecordBatchNotProduceEmptyRowGroup) {
Review Comment:
Can you add comment explaining what this tests?
--
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]