mapleFU commented on code in PR #39211:
URL: https://github.com/apache/arrow/pull/39211#discussion_r1425356988
##########
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:
Yeah, the main reason is because `NewBufferedRowGroup()` is "close if having
a writer and create a new buffered writer", previously, if `offset ==
batch.num_rows()`, it will allocate an empty writer. When file is closed then,
it will leave an empty row-group
`WriteTable` doesn't have this problem because it extract a lambda
expression `WriteRowGroup`, it just "close previously writer, write the
records", and waiting for next `WriteRowGroup` to close the previous writer
--
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]