Skip to content

[VL][TEST] Cover Parquet row-group sizing from Hadoop conf - #12969

Closed
felipepessoto wants to merge 7 commits into
apache:mainfrom
felipepessoto:velox-parquet-rowgroup-test
Closed

felipepessoto wants to merge 7 commits into
apache:mainfrom
felipepessoto:velox-parquet-rowgroup-test

Conversation

@felipepessoto

@felipepessoto felipepessoto commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

Adds focused Velox Parquet row-group coverage for parquet.block.size set on Spark's runtime Hadoop configuration, matching the configuration channel used by Delta's DeletionVectorsWithPredicatePushdownSuite setup.

The plain Parquet suite establishes two controls for a single-partition, 1M-row int64 write through the native Velox writer:

  1. the default 128MB block size produces one row group;
  2. runtime hadoopConfiguration.set("parquet.block.size", 1 MiB in bytes) produces multiple row groups.

The Delta suite applies the same runtime Hadoop configuration to writes with and without deletion vectors. Each test now first asserts that exactly one Parquet data file was produced, then asserts that file contains multiple row groups. This prevents multiple output files from being mistaken for multiple row groups.

backends-velox/src-delta/test is activated only by Maven's delta profile. The focused validation therefore uses -Pdelta together with the Velox, Spark, and Scala profiles so VeloxDeltaParquetRowGroupSuite is compiled and selected explicitly.

The earlier draft also tested spark.gluten.sql.columnar.parquet.write.blockSize. Even when configured as the valid capacity string 1MB, the current writer injection parses it to bytes and re-emits unitless parquet.block.size=1048576, which Velox rejects as an invalid capacity string. That separate production behavior was removed from this test-only patch so it cannot mask the runtime-Hadoop-conf coverage with a setup failure.

How was this patch tested?

Using the repository's focused runner with Spark 3.5, Scala 2.12, Velox, and Delta profiles:

./dev/run-scala-test.sh \
  -Pspark-3.5,scala-2.12,backends-velox,delta \
  -pl backends-velox \
  -s org.apache.spark.sql.execution.VeloxParquetRowGroupSuite \
  -t "native writer should respect parquet.block.size set on the runtime Hadoop conf"

./dev/run-scala-test.sh \
  -Pspark-3.5,scala-2.12,backends-velox,delta \
  -pl backends-velox \
  -s org.apache.gluten.execution.VeloxDeltaParquetRowGroupSuite \
  -t "delta write should respect parquet.block.size set on the runtime Hadoop conf"

./dev/run-scala-test.sh \
  -Pspark-3.5,scala-2.12,backends-velox,delta \
  -pl backends-velox \
  -s org.apache.gluten.execution.VeloxDeltaParquetRowGroupSuite \
  -t "delta write with deletion vectors should respect parquet.block.size on the runtime Hadoop conf"

All three focused tests passed. The two Delta tests were each discovered and executed as one selected test under -Pdelta; there are no intentional failures remaining on Spark 3.5.

Also checked the two changed files with the repository Spotless configuration and current CI license-header checker. A local Spark 4.1 compile was attempted, but this Windows worktree materializes src-delta40 symlinks as text files, so Scala compilation stops on those existing checkout artifacts; CI remains the authoritative Spark 4.1 validation.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: GitHub Copilot App (GPT-5.6 Sol)

@github-actions github-actions Bot added the VELOX label Sep 4, 2026
felipepessoto and others added 6 commits September 14, 2026 17:38
….block.size

Adds VeloxParquetRowGroupSuite to pin down why Delta's
DeletionVectorsWithPredicatePushdownSuite aborts under Gluten (its beforeAll
writes 1M rows with parquet.block.size=2MB on the Hadoop conf and asserts >1 row
group, but Gluten produces a single row group).

Three native-write cases (~8MB of int64, checkNativeWrite asserts the write
offloads to ColumnarWriteFilesExec):
- default 128MB block size -> exactly 1 row group (the Delta-failure scenario);
- spark.gluten.sql.columnar.parquet.write.blockSize=1MB -> multiple row groups
  (the native writer honors its own conf and CAN split);
- parquet.block.size=1MB set on the runtime Hadoop conf (Delta's mechanism) ->
  still 1 row group (it does not reach the native writer).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ts desired behavior)

Flip the third case from characterizing the bug (asserting a single row group) to
reproducing it: it now asserts the DESIRED behavior (> 1 row group), so it FAILS
today (parquet.block.size on the runtime Hadoop conf does not reach Gluten's
native writer -> single row group) and will turn green once that config is plumbed
through to the native writer. The default-block-size and Gluten-conf cases remain
green controls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…roupSuite

- Wrap the runtime `spark.sparkContext.hadoopConfiguration` access with
  `// scalastyle:off/on hadoopconfiguration` (its documented escape hatch);
  the reproduction test must mutate the runtime Hadoop conf on purpose.
- Reflow the header scaladoc to satisfy spotless/scalafmt (wrapMaxColumn=100).

Verified locally: `spotless:check` and `scalastyle:check` both pass on
backends-velox.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR CI showed the plain-Parquet cases in VeloxParquetRowGroupSuite all pass: a
plain `INSERT OVERWRITE DIRECTORY ... USING PARQUET` write DOES honor
`parquet.block.size` set on the runtime Hadoop conf. So the Delta
`DeletionVectorsWithPredicatePushdownSuite` abort is not a generic native-writer
problem -- it is specific to the Delta write path.

Adds VeloxDeltaParquetRowGroupSuite: writes a 1M-row Delta table with
`parquet.block.size` set on the same conf object Delta uses
(`spark.sparkContext.hadoopConfiguration`) and asserts the data file has more
than one row group. This is expected to FAIL today (single row group),
reproducing the abort; the deletion-vectors variant matches the original suite.

Also corrects the now-stale comments in VeloxParquetRowGroupSuite (the runtime
Hadoop-conf block size does reach the native writer for plain Parquet writes).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
org.apache.spark.util.Utils is private[spark] and this suite is in package
org.apache.gluten.execution, so it cannot be referenced here (it also cascaded
into an ambiguous `.sum`). Replace Utils.tryWithResource with a plain
try/finally and make the row-group count explicitly Int.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…roupSuite

Move scalastyle:off marker before withTempPath lambda to cover the entire
hadoopConfiguration access on line 113.
@felipepessoto
felipepessoto force-pushed the velox-parquet-rowgroup-test branch from 90eb817 to 244efe6 Compare September 14, 2026 17:39
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@felipepessoto felipepessoto changed the title [VL][TEST] Reproduce: native Parquet writer ignores Hadoop-conf parquet.block.size [VL][TEST] Cover Parquet row-group sizing from Hadoop conf Sep 16, 2026
@felipepessoto felipepessoto reopened this Sep 18, 2026
@felipepessoto

Copy link
Copy Markdown
Contributor Author

Closing this draft as superseded by #13036 and #13058.

The investigation and green CI here confirmed that parquet.block.size set through Spark’s runtime Hadoop configuration is propagated to Gluten’s native Parquet writer. The Delta fixture failures were therefore not caused by a missing configuration. They occur when the fixture is delivered as one Arrow batch, because Velox evaluates the byte-based flush threshold only after that batch has been written and cannot split it into multiple row groups.

#13036 and #13058 address the affected Delta fixtures deterministically with scoped native row-count limits and validate the resulting downstream tests in the full Delta Spark UT pipeline. The additional 1M-row regression suites in this PR are no longer necessary.

@felipepessoto
felipepessoto deleted the velox-parquet-rowgroup-test branch September 18, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant