Maksim Gaiduk created AVRO-3549:
-----------------------------------

             Summary: [rust] Avro reader fails if it tries to read data 
compressed with codec that is not enabled in features
                 Key: AVRO-3549
                 URL: https://issues.apache.org/jira/browse/AVRO-3549
             Project: Apache Avro
          Issue Type: Bug
          Components: rust
            Reporter: Maksim Gaiduk


Minimal reproducible example:

main.rs: [https://gist.github.com/adensur/e9787daa19522caefe1473c7fcd8464f] 

Cargo.toml: [https://gist.github.com/adensur/b9ebf7cd0714ed15938762375ae5e96e]

The result is different when building with "snappy" codec and without. 
Depending on the input, the result can be just wrong, or it can fail with an 
error similar to this:

`ConvertI64ToUsize(TryFromIntError(()), -1976)'`

>From the code, it looks like the reader tries to parse known codecs from 
>writer schema, and just uses default codec if it fails 
>[https://github.com/apache/avro/blob/master/lang/rust/avro/src/reader.rs#L202] 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to