polars_arrow/io/avro/
mod.rs1pub use avro_schema;
4
5pub mod read;
6pub mod write;
7
8macro_rules! avro_decode {
10 ($reader:ident $($_await:tt)*) => {
11 {
12 let mut i = 0u64;
13 let mut buf = [0u8; 1];
14 let mut j = 0;
15 loop {
16 if j > 9 {
17 polars_error::polars_bail!(oos = "zigzag decoding failed - corrupt avro file")
19 }
20 $reader.read_exact(&mut buf[..])$($_await)*?;
21 i |= (u64::from(buf[0] & 0x7F)) << (j * 7);
22 if (buf[0] >> 7) == 0 {
23 break;
24 } else {
25 j += 1;
26 }
27 }
28
29 Ok(i)
30 }
31 }
32}
33
34pub(crate) use avro_decode;