polars-arrow 0.53.0

Minimal implementation of the Arrow specification forked from arrow2
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::io::Read;

use polars_error::PolarsResult;

use super::super::avro_decode;

pub fn zigzag_i64<R: Read>(reader: &mut R) -> PolarsResult<i64> {
    let z = decode_variable(reader)?;
    Ok(if z & 0x1 == 0 {
        (z >> 1) as i64
    } else {
        !(z >> 1) as i64
    })
}

fn decode_variable<R: Read>(reader: &mut R) -> PolarsResult<u64> {
    avro_decode!(reader)
}