Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Made kafka schema_id u32
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Jul 13, 2022
1 parent 6de9edf commit b1abda2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/avro_kafka.rs
Expand Up @@ -4,7 +4,7 @@ use arrow2::{
io::avro,
};

fn read_schema_id<R: std::io::Read>(reader: &mut R) -> Result<i32, Error> {
fn read_schema_id<R: std::io::Read>(reader: &mut R) -> Result<u32, Error> {
let mut header = [0; 5];
reader.read_exact(&mut header)?;

Expand All @@ -13,7 +13,7 @@ fn read_schema_id<R: std::io::Read>(reader: &mut R) -> Result<i32, Error> {
"Avro requires the first byte to be a zero".to_string(),
));
}
Ok(i32::from_be_bytes(header[1..].try_into().unwrap()))
Ok(u32::from_be_bytes(header[1..].try_into().unwrap()))
}

fn read_block<R: std::io::Read>(reader: &mut R, block: &mut avro::Block) -> Result<(), Error> {
Expand Down

0 comments on commit b1abda2

Please sign in to comment.