Commits


Florian Müller authored and Andy Grove committed 06ac7509adb
ARROW-10927: [Rust][Parquet] Add Decimal to ArrayBuilderReader This PR introduces capabilities to construct a `DecimalArray` from Parquet files. This is done by adding a new `Converter<Vec<Option<ByteArray>>, DecimalArray>` in `parquet::arrow::converter`: ``` pub struct DecimalArrayConverter { precision: i32, scale: i32, } ``` It is then used in `ArrayBuilderReader` using a match guard to differentiate it from regular fixed size binaries: ``` PhysicalType::FIXED_LEN_BYTE_ARRAY if cur_type.get_basic_info().logical_type() == LogicalType::DECIMAL => ``` A test was added that uses a parquet file from `PARQUET_TEST_DATA` to check whether loading and casting to `DecimalArray` works. I did not find a corresponding json file with the correct values, but I used `pyarrow` to extract the correct values and hard coded them in the test. I thought that this PR would require #8784 to be merged, but they are independent. I used the same JIRA issue here - I hope that this is okay. Closes #8880 from sweb/rust-parquet-decimal-arrow-reader Authored-by: Florian Müller <florian@tomueller.de> Signed-off-by: Andy Grove <andygrove73@gmail.com>