Expose cuDF Parquet writer row group size configs#14783
Conversation
Signed-off-by: Haoyang Li <haoyangl@nvidia.com>
|
@greptile full review |
Greptile SummaryThis PR exposes two internal cuDF pass-through knobs —
Confidence Score: 5/5Safe to merge; the new code paths add optional pass-through knobs with no effect when unset, both write paths are updated symmetrically, and the warning logic is covered by unit tests. The functional changes are additive and gated behind optional configs that default to None, so existing Parquet write behaviour is entirely unchanged. Both the standard and Hive GPU writer paths are treated consistently. The only concern is that the bytes-splitting test ties assertions to cuDF's internal per-row estimation math, which could become a flaky failure if cuDF changes how it accounts for page overhead — but this does not affect production correctness. tests/src/test/scala/com/nvidia/spark/rapids/ParquetWriterSuite.scala — the byte-budget test assertions are fragile; the production files are clean. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[prepareWrite called] --> B{non-default BLOCK_SIZE?}
B -- yes --> C[logWarning on driver]
B -- no --> D[continue]
C --> D
D --> E[Read rowGroupSizeRows and rowGroupSizeBytes from RapidsConf]
E --> F[ColumnarOutputWriterFactory]
F --> G[partitionFlushSize uses rowGroupSizeBytes if set]
F --> H{writer type}
H -- standard --> I[GpuParquetWriter]
H -- hive --> J[GpuHiveParquetWriter]
I --> K[builder.withRowGroupSizeRows / withRowGroupSizeBytes]
J --> K
K --> L[Table.writeParquetChunked]
Reviews (6): Last reviewed commit: "block size warning" | Re-trigger Greptile |
Signed-off-by: Haoyang Li <haoyangl@nvidia.com>
| val rowGroupCounts = getSingleParquetFileRowGroupCounts(spark, writePath) | ||
| assert(rowGroupCounts.length > 1, s"Expected multiple row groups, got $rowGroupCounts") | ||
| assertResult(10000L) { | ||
| rowGroupCounts.sum |
There was a problem hiding this comment.
check that each row group is less than #rows and #bytes.
There was a problem hiding this comment.
Do any of these tests actually check the byte size of the row group that is written? It doesn't look like it?
There was a problem hiding this comment.
Good catch. Yesterday I avoided a direct totalByteSize <= rowGroupSizeBytes assertion because BlockMetaData.getTotalByteSize includes Parquet page/encoding overhead; with a 1024-byte limit I saw footer sizes like 1064 bytes even though cuDF was honoring the limit based on its uncompressed data-size estimate.
I updated the test to check both now: the estimated data bytes used for cuDF row-group splitting, and the actual footer totalByteSize with a small 512-byte overhead allowance.
Signed-off-by: Haoyang Li <haoyangl@nvidia.com>
|
build |
Fixes #14782.
Related to #9126.
Description
This PR exposes two internal Spark RAPIDS configs for tuning cuDF Parquet writer row group limits:
spark.rapids.sql.format.parquet.writer.rowGroupSizeRowsspark.rapids.sql.format.parquet.writer.rowGroupSizeBytesThese configs are cuDF-specific pass-through knobs and are documented as best-effort limits. They are not mapped from Spark
parquet.block.size, because cuDF row group sizing is based on uncompressed estimates and page-fragment boundaries rather than Spark exactparquet.block.sizebehavior.The implementation wires the options into both the standard GPU Parquet writer and the Hive GPU Parquet writer. When the byte limit is set, the standard Parquet writer factory also uses it for partition flush sizing so concurrent output writer buffering is consistent with the configured row group byte target.
This PR also adds a warning when
parquet.block.sizeis set to a non-default value for GPU Parquet writes. The warning explains that RAPIDS GPU Parquet writer does not apply Spark CPU writer row group sizing semantics forparquet.block.size, points users tospark.rapids.sql.format.parquet.write.enabled=falseif they require CPU writer behavior, and lists the two internal RAPIDS-specific row group tuning configs for experimentation.Tests were added to
ParquetWriterSuiteto verify that the row-based and byte-based configs affect the written Parquet row groups. The rows test uses an observable row count because cuDF does not split row groups below its page fragment granularity. The suite also covers theparquet.block.sizewarning helper for unset/default/non-default values.Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance