You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "dwsmith1983 (via GitHub)" <gi...@apache.org> on 2026/09/09 13:26:22 UTC
[I] Duplicate field ids inside a struct are not validated when the file schema equals the requested schema and no predicate is pushed [datafusion-comet]
dwsmith1983 opened a new issue, #5801:
URL: https://github.com/apache/datafusion-comet/issues/5801
### Describe the bug
Comet validates Parquet field id lookups in the physical expression adapter, which resolves each file's mapping once per file (#5654). DataFusion 55's Parquet opener skips the adapter entirely when the file's physical schema compares equal to the logical schema and there is no pushed predicate. In that case a file whose struct carries two children with the same field id is read positionally instead of failing with Spark's duplicate field id error.
Spark-written files always carry key-value metadata that arrow-rs folds into the physical schema, so they never compare equal and always reach the adapter. The gap is limited to files with no key-value metadata at all, read with field id matching enabled and no data filter.
### Steps to reproduce
1. Write a Parquet file without key-value metadata whose schema is `s<x: long id=1, y: long id=1>` (parquet-mr with a hand-built MessageType).
2. Read it with the native scan, `spark.sql.parquet.fieldId.read.enabled=true`, and a requested schema identical to the file schema, with no filter.
3. Spark rejects the duplicate id during schema clipping; Comet returns the rows.
### Expected behavior
The duplicate field id error, as when a cast or predicate is present.
### Additional context
Found in review of #5654, where the once-per-file validation was added. The short circuit is in DataFusion's opener, so the fix is either a Comet-side check before the opener decides, or an upstream option to always run the adapter.
--
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] Duplicate field ids inside a struct are not validated when the file schema equals the requested schema and no predicate is pushed [datafusion-comet]
Posted by "dwsmith1983 (via GitHub)" <gi...@apache.org>.
dwsmith1983 commented on issue #5801:
URL: https://github.com/apache/datafusion-comet/issues/5801#issuecomment-5672595635
> Let's fall back to Spark if we cannot resolve promptly. We should try to avoid producing wrong results silently.
Agreed on the principle. #5654 already closes this one without a silent path: the footer check validates the columns a read requests, and the adapter raises Spark's duplicate field id error for a referenced column that matches two file fields, including the no-metadata, no-predicate case where DataFusion's opener skips the adapter. It is waiting on merge order with #5786, which adds a broader pre-decoder guard on the same call site.
--
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] Duplicate field ids inside a struct are not validated when the file schema equals the requested schema and no predicate is pushed [datafusion-comet]
Posted by "dwsmith1983 (via GitHub)" <gi...@apache.org>.
dwsmith1983 commented on issue #5801:
URL: https://github.com/apache/datafusion-comet/issues/5801#issuecomment-5604052852
@andygrove I will do this as well.
--
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] Duplicate field ids inside a struct are not validated when the file schema equals the requested schema and no predicate is pushed [datafusion-comet]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead closed issue #5801: Duplicate field ids inside a struct are not validated when the file schema equals the requested schema and no predicate is pushed
URL: https://github.com/apache/datafusion-comet/issues/5801
--
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] Duplicate field ids inside a struct are not validated when the file schema equals the requested schema and no predicate is pushed [datafusion-comet]
Posted by "kazuyukitanimura (via GitHub)" <gi...@apache.org>.
kazuyukitanimura commented on issue #5801:
URL: https://github.com/apache/datafusion-comet/issues/5801#issuecomment-5667977683
Let's fall back to Spark if we cannot resolve promptly. We should try to avoid producing wrong results silently.
--
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