nssalian commented on code in PR #16327:
URL: https://github.com/apache/iceberg/pull/16327#discussion_r3368010692
##########
parquet/src/test/java/org/apache/iceberg/parquet/TestParquetDataWriter.java:
##########
@@ -543,4 +546,70 @@ protected int resolveColumnIndex(Void engineSchema, String
columnName) {
variantSchema.asStruct(), variantRecords.get(i),
writtenRecords.get(i));
}
}
+
+ @ParameterizedTest
+ @ValueSource(strings = {"gzip", "snappy", "zstd", "uncompressed"})
+ public void testRowGroupSizeEnforcedWhenCompressionEnabled(String codec)
throws IOException {
+ // With uncompressed tracking, row groups split at the configured target
+ DataFile dataFile = writeCompressibleRecords(codec, true);
+
+ assertThat(dataFile.recordCount()).as("Record count should
match").isEqualTo(30);
+ assertThat(dataFile.splitOffsets().size())
+ .as("Row group count should reflect enforcement of the target")
+ .isGreaterThanOrEqualTo(3);
+ }
+
+ @Test
+ public void testDefaultPathUsesCompressedSize() throws IOException {
+ // Without uncompressed tracking, compressed bytes never hit the target
+ DataFile dataFile = writeCompressibleRecords("snappy", false);
+ DataFile trackedFile = writeCompressibleRecords("snappy", true);
+
+ assertThat(dataFile.splitOffsets().size())
+ .as("Default path should use compressed size (single row group due to
compression)")
Review Comment:
Done
##########
core/src/main/java/org/apache/iceberg/TableProperties.java:
##########
@@ -176,6 +176,10 @@ private TableProperties() {}
"write.delete.parquet.row-group-check-max-record-count";
public static final int PARQUET_ROW_GROUP_CHECK_MAX_RECORD_COUNT_DEFAULT =
10000;
+ public static final String PARQUET_ROW_GROUP_SIZE_CHECK_UNCOMPRESSED =
+ "write.parquet.row-group-size-check-uncompressed";
Review Comment:
Done.
--
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]