shivadarshan-devadiga opened a new pull request, #13672:
URL: https://github.com/apache/gluten/pull/13672
## What changes are proposed in this pull request?
Fixes #13671
Related to #11914 / #13398.
Since Spark 4.1 (SPARK-53535),
`spark.sql.legacy.parquet.returnNullStructIfAllFieldsMissing` defaults to
`false`. `getNativeSessionConf` only passed the key to native when it was set
in the session, and `ConfigExtractor.cc` falls back to `true`. So with the
default config, the Velox scan returned null for every struct whose requested
fields are all missing from the file, where Spark only returns null for structs
that are null in the file.
This PR adds the key to the configs whose Spark default is passed to native
when unset. The default is `false` on Spark 4.1+. On Spark 3.4–4.0 the config
doesn't exist and Spark behaves as if it were `true`, so `true` is passed
there, which is the native fallback that applied before. A value set in the
session still takes precedence.
## How was this patch tested?
- New test in `VeloxScanSuite`: writes a struct column with a null row,
reads it with a schema whose struct fields are all missing from the file, and
leaves the config unset. On Spark 4.1+ it expects a non-null struct for the
non-null rows. On earlier versions it expects null for every row. It also
checks that the scan is offloaded.
- `backends-velox` compiles, including test sources, and passes scalastyle
with `-Pspark-3.5` and with `-Pspark-4.1 -Pscala-2.13 -Pjava-17`.
`spotless:apply` makes no changes.
- The new test wasn't run locally, because it needs a native build. CI runs
`VeloxScanSuite` on every supported Spark version, including 4.1 and 4.2.
- Checked by hand with Spark 4.1.1, the Gluten nightly bundle
`gluten-velox-bundle-spark4.1_2.13-linux_aarch64-1.9.0-SNAPSHOT` from
2026-11-18, and this PR's `GlutenConfig` put ahead of the bundle on the
classpath. The query is the repro in #13671; the scan is offloaded in every
Gluten run:
| Run | id 0 | id 1 | id 2 |
|---|---|---|---|
| Vanilla Spark, config unset | `{"x":null}` | `NULL` | `{"x":null}` |
| Gluten nightly, config unset | `NULL` | `NULL` | `NULL` |
| Gluten with this PR, config unset | `{"x":null}` | `NULL` | `{"x":null}`
|
| Gluten with this PR, config `true` | `NULL` | `NULL` | `NULL` |
## Was this patch authored or co-authored using generative AI tooling?
Co-authored by: Claude Sonnet 4.5
--
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]