shivadarshan-devadiga opened a new issue, #13826:
URL: https://github.com/apache/gluten/issues/13826

   ### Backend
   
   VL (Velox)
   
   ### Bug description
   
   Expected behavior] With `ignoreCorruptFiles` set, Spark skips a file it 
can't read and returns the rows of the other files:
   
   - File sources (`spark.read.parquet`, `orc`, and V1 and V2 scans of data 
source tables) skip it when `spark.sql.files.ignoreCorruptFiles` or the 
`ignoreCorruptFiles` read option is set. The read option wins over the conf 
(`FileSourceOptions.ignoreCorruptFiles`).
   - Hive tables read through the Hive SerDe (`HadoopRDD`) skip a file that 
fails with an `IOException` while it's read. Since Spark 4.0 (SPARK-45316) they 
do so when `spark.sql.files.ignoreCorruptFiles` is set; on Spark 3.x, when the 
core conf `spark.files.ignoreCorruptFiles` is set.
   
   [Actual behavior] Velox has no option to skip corrupt files, and Gluten 
passes none of these settings to it, so the native scan fails the query:
   
   ```
   org.apache.gluten.exception.GlutenException: Exception: VeloxRuntimeError
   Error Source: RUNTIME
   Error Code: INVALID_STATE
   Reason: No magic bytes found at end of the Parquet file
   ```
   
   Repro on Spark 3.5.4 with the Gluten nightly 
`gluten-velox-bundle-spark3.5_2.12-linux_aarch64-1.9.0-SNAPSHOT` from 
2026-11-27. The data is a Parquet dir with ids 0 to 99 and a dir whose only 
file is replaced with the text `this is not a parquet file`:
   
   ```scala
   spark.read.schema("id LONG").parquet(good, bad).selectExpr("sum(id)")
   ```
   
   | `spark.sql.files.ignoreCorruptFiles` | read option | Vanilla Spark | 
Gluten |
   |---|---|---|---|
   | true | (none) | 4950 | error |
   | false | true | 4950 | error |
   | false | (none) | error | error |
   | true | false | error | error |
   
   Hive tables on Spark 3.5.4, with the core conf (`convertMetastoreOrc=false`, 
`spark.sql.adaptive.enabled=false`):
   
   | Table | `spark.files.ignoreCorruptFiles` | Vanilla Spark | Gluten |
   |---|---|---|---|
   | ORC, one good file and a garbage file, `hive.exec.orc.split.strategy=BI` | 
true | 1 | error: `Corrupted file, Post script size is invalid` |
   | text, `good.txt` with 1 and 2, and a truncated `.gz` file | true | 3 | 
error |
   
   With the default ORC split strategy, or for a Hive Parquet table, vanilla 
Spark fails too: the ORC footer is read while computing the splits, and 
Parquet's "not a Parquet file" is a `RuntimeException`, not an `IOException`. 
So those cases already match.
   
   ClickHouse has no support for skipping corrupt files either (#3915 was 
closed without a change).
   
   The fix I propose: fall back the scan when Spark would skip corrupt files. 
Native support in Velox, which would skip a split whose reader fails, could 
follow.
   
   ### Gluten version
   
   main branch
   
   ### Spark version
   
   Spark-3.5.x
   
   ### Spark configurations
   
   _No response_
   
   ### System information
   
   _No response_
   
   ### Relevant logs
   
   ```bash
   
   ```


-- 
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]

  • [I] [VL] Native scan fails ... shivadarshan-devadiga (via GitHub) via commits

Reply via email to