huaxingao commented on code in PR #16327:
URL: https://github.com/apache/iceberg/pull/16327#discussion_r3368535293
##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetWriter.java:
##########
@@ -190,20 +204,31 @@ public List<Long> splitOffsets() {
}
private void checkSize() {
- if (recordCount >= nextCheckRecordCount) {
- long bufferedSize = writeStore.getBufferedSize();
- double avgRecordSize = ((double) bufferedSize) / recordCount;
+ if (trackUncompressedSize) {
+ if (rowGroupUncompressedSize >= targetRowGroupSize) {
+ flushRowGroup(false);
+ } else {
+ evaluateRowGroupSize(rowGroupUncompressedSize, false);
+ }
+ } else {
+ evaluateRowGroupSize(writeStore.getBufferedSize(), true);
Review Comment:
One last comment. Everything else looks good.
Now `writeStore.getBufferedSize()` gets evaluated every record, but in the
original method it's only evaluated when `recordCount >= nextCheckRecordCount`.
Since that call walks all column writers, this adds per-record cost to the
default path. Could we keep the `recordCount >= nextCheckRecordCount `gate
outside `evaluateRowGroupSize`?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]