From 6f0892e46f9d7d1fcc836c01558380fcf63a7c6b Mon Sep 17 00:00:00 2001 From: "Jorge C. Leitao" Date: Thu, 11 Nov 2021 21:53:03 +0000 Subject: [PATCH] Added reading of null from parquet. --- src/io/parquet/read/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/io/parquet/read/mod.rs b/src/io/parquet/read/mod.rs index aa2b051849d..673a23b727b 100644 --- a/src/io/parquet/read/mod.rs +++ b/src/io/parquet/read/mod.rs @@ -27,7 +27,7 @@ pub use parquet2::{ }; use crate::{ - array::{Array, DictionaryKey, PrimitiveArray}, + array::{Array, DictionaryKey, NullArray, PrimitiveArray}, datatypes::{DataType, IntervalUnit, TimeUnit}, error::{ArrowError, Result}, io::parquet::read::nested_utils::create_list, @@ -234,6 +234,10 @@ pub fn page_iter_to_array Result> { use DataType::*; match data_type.to_logical_type() { + Null => Ok(Box::new(NullArray::from_data( + data_type, + metadata.num_values() as usize, + ))), // INT32 UInt8 => primitive::iter_to_array(iter, metadata, data_type, |x: i32| x as u8), UInt16 => primitive::iter_to_array(iter, metadata, data_type, |x: i32| x as u16), @@ -346,6 +350,10 @@ pub async fn page_stream_to_array Result> { use DataType::*; match data_type.to_logical_type() { + Null => Ok(Box::new(NullArray::from_data( + data_type, + metadata.num_values() as usize, + ))), // INT32 UInt8 => primitive::stream_to_array(pages, metadata, data_type, |x: i32| x as u8).await, UInt16 => primitive::stream_to_array(pages, metadata, data_type, |x: i32| x as u16).await,