You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2026/09/05 14:52:44 UTC

[I] Nested Parquet cast retention accepts an ambiguous case-insensitive field match [datafusion-comet]

andygrove opened a new issue, #5707:
URL: https://github.com/apache/datafusion-comet/issues/5707

   ### Describe the bug
   
   `is_pure_structural_narrowing` (`native/core/src/parquet/schema_adapter.rs`) decides whether Comet can leave DataFusion's `CastExpr` in place so apache/datafusion#24090's nested leaf pruning fires. It requires an *exact*, case-sensitive name match for every target field:
   
   ```rust
   source_fields
       .iter()
       .find(|f| f.name() == target_field.name())
       .is_some_and(|source_field| ...)
   ```
   
   An exact match is not the same as an unambiguous one. With `spark.sql.caseSensitive=false`, a Parquet column `s: struct<ID: bigint, id: bigint>` read through the explicit schema `s: struct<id: bigint>` passes this check, so the generic cast is retained and returns `id`. Spark, and Comet's own `spark_parquet_convert`, instead reject the ambiguity.
   
   So a query Spark errors on can now silently return one of the two candidate fields.
   
   ### Steps to reproduce
   
   Read a Parquet file whose struct has two fields differing only in case, requesting one of them by its exact name, with `spark.sql.caseSensitive=false`.
   
   ### Expected behavior
   
   Uniqueness is required under Spark's configured name resolver at each nested struct level before the cast is retained; otherwise fall back to `CometCastColumnExpr` and let the existing duplicate-field check fire.
   
   ### Additional context
   
   The existing `CAFÉ`/`café` native-reader regression asks for `Café`, so it does not cover the case where one sibling matches exactly. A regression requesting `café` (or `id`) exactly should be added alongside the fix.
   
   Raised during review of #5262; @comphead agreed it is a follow-up rather than a blocker.
   


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Nested Parquet cast retention accepts an ambiguous case-insensitive field match [datafusion-comet]

Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on issue #5707:
URL: https://github.com/apache/datafusion-comet/issues/5707#issuecomment-5561665510

   take


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Nested Parquet cast retention accepts an ambiguous case-insensitive field match [datafusion-comet]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove commented on issue #5707:
URL: https://github.com/apache/datafusion-comet/issues/5707#issuecomment-5552616934

   Tracked under #5709 ([EPIC] DataFusion 55 upgrade follow-ups).


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Nested Parquet cast retention accepts an ambiguous case-insensitive field match [datafusion-comet]

Posted by "sunchao (via GitHub)" <gi...@apache.org>.
sunchao closed issue #5707: Nested Parquet cast retention accepts an ambiguous case-insensitive field match
URL: https://github.com/apache/datafusion-comet/issues/5707


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org