felipepessoto opened a new pull request, #13667: URL: https://github.com/apache/gluten/pull/13667
## What changes are proposed in this pull request? <!-- Provide a clear and concise description of the changes introduced in this PR. Ensure the PR description aligns with the code changes, especially after updates. If applicable, include "Fixes #<GitHub_Issue_ID>" to automatically close the corresponding issue when the PR is merged. --> Relates to #11494. Fall back to Spark when a required file-scan column has a non-null `EXISTS_DEFAULT`. Native readers currently return NULL for physically missing fields rather than materializing these existing-row defaults. Spark's reader preserves the original default while leaving explicitly stored NULLs unchanged. The shared file-scan validation also covers Delta scans. A small helper in each Spark 3.4-4.2 file-scan shim delegates to Spark's own existence-default evaluation, avoiding false positives for typed NULL defaults. The implementation is independently authored against the current scan code and Spark APIs. Add shared `GlutenFileScanSuite` regressions across the Spark versions and a Velox Delta conversion regression. Cover old rows, stored NULLs, changed/dropped write defaults, filter-only references, column pruning, empty-schema counts, and NULL-default/native controls. Update the Delta support documentation; expected data and failure baselines are unchanged. **Trade-off:** this is a conservative schema-based fallback, not native default materialization. A scan can fall back even when every file already contains the column. Pruned-away columns and NULL existence defaults do not trigger the guard. Native support remains follow-up work, so the issue reference is non-closing. ## How was this patch tested? <!-- Describe how the changes were tested, if applicable. Include new tests to validate the functionality, if necessary. For UI-related changes, attach screenshots to demonstrate the updates. --> Validated in an isolated Linux copy with real repository symlinks, using JDK 17 and the native libraries built by [CI run 43781825980](https://github.com/apache/gluten/actions/runs/43781825980), restored before the JVM build. The changed files were checked to be byte-identical to this branch. Native C++ was not rebuilt locally. - Spark 4.1 / Scala 2.13: compiled the production/backend modules and regression-test modules. Ran exactly three focused ScalaTest cases with the native backend: **3 passed, 0 failed**. - `GlutenFileScanSuite`: `Gluten - file scan preserves existence defaults and stored nulls` and `Gluten - file scan keeps null existence defaults native after changing the write default`. - `VeloxDeltaSuite`: `delta: converted existence defaults fall back only when read`, including the old-row `(0, 1)` result, a stored NULL, and a native pruned-column control. - Spark 3.4 / Scala 2.12: successful clean compile of `gluten-substrait` and its reactor dependencies, including the Spark 3.4 shim. - Passed `dev/format-scala-code.sh`, the changed-file license-header check, and `git diff --check`. The full upstream Delta 4.4.1 suite and the remaining Spark runtime matrix were not run locally; no baseline entries were removed. ## Was this patch authored or co-authored using generative AI tooling? <!-- If generative AI tooling has been used in the process of authoring this patch, please include the phrase: 'Generated-by: ' followed by the name of the tool and its version. If no, write 'No'. Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details. --> Generated-by: GitHub Copilot 1.0.106-8.unstable.r43566476370.g869eef3 (GPT-6 Astra) -- 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]
