geoHeil opened a new issue, #27327:
URL: https://github.com/apache/datafusion/issues/27327

   ### Describe the bug
   
   `ParquetSource::try_from_proto` uses each legacy projection index with 
`schema.field(i as usize)` while it builds the predicate schema. An index 
outside the schema panics before the constructor can return an error. A 
predicate is not required.
   
   ### Reproduce
   
   The serialized `PhysicalPlanNode` is eight bytes:
   
   ```text
   hex:    0a060a041200200a
   base64: CgYKBBIAIAo=
   ```
   
   It describes a Parquet scan with an empty schema and projection `[10]`. 
Decoding it with DataFusion 55.1.0 panics in Arrow with `index out of bounds: 
the len is 0 but the index is 10`.
   
   A downstream worker regression reproduces that panic against the original 
decoder and passes with a bounds check: 
https://github.com/telekom/sutura/actions/runs/43001290751/job/130459222254
   
   The unchanged input and downstream fix are in 
https://github.com/telekom/sutura/pull/1878. The original release-fuzz failure 
is https://github.com/telekom/sutura/actions/runs/42981741003/job/130393510786.
   
   ### Expected behavior
   
   Return an error for an invalid projection index. A decoder returning 
`Result` should not panic on this input.
   
   ### Additional context
   
   Upstream main still contains the unchecked lookup at [this exact 
revision](https://github.com/apache/datafusion/blob/34eb6dc5bf057a35c471a4fbfd2eece2a7937afe/datafusion/datasource-parquet/src/source.rs#L1205).
 This is a source inspection; I have not run the input against upstream main.
   
   The downstream check is at the existing `datafusion-proto` boundary. It does 
not fix direct calls to the datasource constructor or other malformed plan 
fields. An upstream check in the datasource decoder would cover its direct 
callers too.
   
   AI assistance was used to investigate and draft this report.
   


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