felixloesing opened a new pull request, #13776:
URL: https://github.com/apache/gluten/pull/13776

   ## What changes are proposed in this pull request?
   An Iceberg scan that plans no data files falls back to vanilla Spark, even 
though there is nothing to read. This happens for an empty table, or when 
partition or file pruning removes every file. Gluten reads two things from the 
planned scan tasks, and with no tasks both checks throw:
   - **File format:** `getFileFormatAndRootPaths` throws `Iceberg Only support 
parquet and orc file format`.
   - **Partition schema:** `getReadPartitionSchema` throws `Failed to get 
partition schema from iceberg scan`.
   
   The scan falls back, and the plan around it gets extra row/columnar 
transitions.
   
   This PR changes GlutenIcebergSourceUtil to:
   - **File format:** when no tasks are planned, use the table's 
`write.format.default` (Parquet if unset). Formats other than Parquet and ORC 
are still rejected with the same message.
   - **Partition schema:** when no tasks are planned, return an empty partition 
schema.
   
   This works for every supported scan type: batch, copy-on-write and staged 
scans. Root paths stay empty for these scans, so file scheme validation has 
nothing to check.
   
   ## How was this patch tested?
   Added iceberg scan with no data files to `IcebergSuite`. It checks that 
`IcebergScanTransformer` is used and results match vanilla Spark for:
   - a newly created empty table,
   - a partitioned table where the filter prunes every partition (`name = 
'v3'`),
   - a filter on a data column that matches no rows, with `limit 1 (id > 100)`.
   
   ## Was this patch authored or co-authored using generative AI tooling?
   Generated-by: Claude Code (Claude Opus 5.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]

Reply via email to