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

   ### Describe the bug
   
   The Parquet file format proto decoder can panic while decoding malformed 
`TableParquetOptions` bytes.
   
   `ParquetLogicalExtensionCodec::try_decode_file_format` returns a `Result`, 
but it converts decoded `TableParquetOptionsProto` through an infallible 
`FromProto` path. That path parses `ParquetOptionsProto.writer_version` with 
`expect`, so an invalid value such as `"3.0"` aborts the decode path instead of 
returning a DataFusion error.
   
   ### To Reproduce
   
   Construct a `TableParquetOptionsProto` with a present `global` options 
message and an invalid writer version:
   
   ```rust
   TableParquetOptionsProto {
       global: Some(ParquetOptionsProto {
           writer_version: "3.0".to_string(),
           ..Default::default()
       }),
       ..Default::default()
   }
   ```
   
   Encode it and pass the bytes to 
`ParquetLogicalExtensionCodec::try_decode_file_format`.
   
   ### Expected behavior
   
   The decoder should return an error, consistent with the 
`try_decode_file_format` API and the existing writer-version validation.
   
   ### Additional context
   
   An empty proto `writer_version` should continue to use DataFusion's default 
writer version so proto default values remain compatible.
   


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