nssalian commented on code in PR #16327:
URL: https://github.com/apache/iceberg/pull/16327#discussion_r3314151259
##########
parquet/src/test/java/org/apache/iceberg/parquet/TestParquetDataWriter.java:
##########
@@ -543,4 +546,69 @@ protected int resolveColumnIndex(Void engineSchema, String
columnName) {
variantSchema.asStruct(), variantRecords.get(i),
writtenRecords.get(i));
}
}
+
+ @ParameterizedTest
+ @ValueSource(strings = {"gzip", "snappy", "zstd", "uncompressed"})
Review Comment:
I'd like to keep gzip but maybe lower the bounds so we run quickly?
##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetWriter.java:
##########
@@ -190,6 +204,30 @@ public List<Long> splitOffsets() {
}
private void checkSize() {
+ if (trackUncompressedSize) {
+ checkSizeUncompressed();
+ } else {
+ checkSizeCompressed();
+ }
+ }
+
+ private void checkSizeUncompressed() {
+ if (rowGroupUncompressedSize >= targetRowGroupSize) {
+ flushRowGroup(false);
+ } else if (recordCount >= nextCheckRecordCount) {
+ double avgRecordSize = ((double) rowGroupUncompressedSize) / recordCount;
+ if (rowGroupUncompressedSize > (targetRowGroupSize - 2 * avgRecordSize))
{
Review Comment:
Will clean up.
--
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]