[SkipRecovery] Restore empty partitioned Parquet write tests [reduced-it] [databricks] - #15949
[SkipRecovery] Restore empty partitioned Parquet write tests [reduced-it] [databricks]#15949wjxiz1992 wants to merge 1 commit into
Conversation
Signed-off-by: Allen Xu <allxu@nvidia.com>
|
There was a problem hiding this comment.
🟡 Changes recommended
The new helper always sets spark.sql.maxConcurrentOutputFileWriters even when the value is 0, conflicting with established test semantics in the same file where 0 means “do not set the option,” which can change the single-writer case behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Restores previously skipped integration test coverage for empty, partitioned Parquet writes by asserting the shared Spark CPU/GPU behavior: schema inference fails when output contains no data files, while reading with an explicit schema succeeds and returns no rows.
Changes:
- Replaces two
skipif(True)tests with active assertions that validate the expectedAnalysisExceptionon schema inference and a successful explicit-schema readback. - Factors common logic into
_assert_write_empty_partitioned_data(...)and applies it to both the concurrent-writer and single-writer test cases. - Adds
@validate_execs_in_gpu_plan("GpuDataWritingCommandExec")to ensure the GPU writer path is exercised.
File summaries
| File | Description |
|---|---|
| integration_tests/src/main/python/parquet_write_test.py | Restores the empty partitioned Parquet write tests and verifies CPU/GPU parity for schema inference vs explicit-schema readback. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| assert_gpu_and_cpu_writes_are_equal_collect( | ||
| lambda spark, path: spark.createDataFrame(spark.sparkContext.parallelize(data), schema) | ||
| .write.mode("overwrite").partitionBy('c1', 'c2').parquet(path), | ||
| read_empty_data, | ||
| data_path, | ||
| conf={"spark.sql.maxConcurrentOutputFileWriters": max_concurrent_writers}) |
|
build |
JaCoCo production line coverage: not fully measurable locally — no compatible nightly/runtime bytecode tuple (all five report groups N/A; details below).
Contributes to #6453.
Description
This test-only change restores two skipped checks for empty partitioned Parquet writes. Their original readback expected Spark to infer a schema from output with no data files, which also fails on CPU. The restored tests verify the shared CPU/GPU behavior: schema inference fails, while reading with the declared schema returns no rows. Production behavior is unchanged; these two cases showed no CPU/GPU divergence.
Both the single-writer and concurrent-writer cases compare CPU/GPU outputs and require
GpuDataWritingCommandExec. Existing test names are retained. This recovers the two exclusions linked to #6453 without claiming to resolve that issue's broader file-format scope.AI assistance: The change and PR description were prepared with Codex assistance.
Validation
parquet_write_test.py: 387 passed, 1 skipped (385.75 seconds).Commands, CI selection, and coverage provenance
Built from
b50f7744723118d5bd63b419fc280a8e52d1a447:[reduced-it]retains both recovered cases: neither test has a parametrization decorator, and each collected one node. The full enclosing file was run without reduced selection. Scala unit tests retain the parallel default.[databricks]requests coverage for these shared tests.JaCoCo execution data was collected for the current runtime. The refreshed nightly is Scala 2.12 / shim 350 / 26.10.0-SNAPSHOT b21 at
7ad4b98727db387b84a5030c34463733da45cf5f. No compatible complete baseline/runtime/classfile tuple was available: the older local runtime candidate has class-ID mismatches insql-pluginandiceberg, while the current runtime contains newer production bytecode. All five report groups (sql-plugin,iceberg,shuffle-plugin,udf-compiler, anddelta-lake) are N/A for marginal contribution; none is reported as measured zero. The shim-350 Delta group is a stub, not real Delta Lake coverage.Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance