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

Made kafka schema_id u32 in example #1162

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/avro_kafka.rs
Original file line number Diff line number Diff line change
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