alamb commented on code in PR #2835:
URL: https://github.com/apache/arrow-rs/pull/2835#discussion_r993831833
##########
parquet/src/arrow/array_reader/primitive_array.rs:
##########
@@ -169,15 +170,21 @@ where
.null_bit_buffer(self.record_reader.consume_bitmap_buffer());
let array_data = unsafe { array_data.build_unchecked() };
- let array = match T::get_physical_type() {
- PhysicalType::BOOLEAN => Arc::new(BooleanArray::from(array_data))
as ArrayRef,
- PhysicalType::INT32 => Arc::new(Int32Array::from(array_data)) as
ArrayRef,
- PhysicalType::INT64 => Arc::new(Int64Array::from(array_data)) as
ArrayRef,
- PhysicalType::FLOAT => Arc::new(Float32Array::from(array_data)) as
ArrayRef,
- PhysicalType::DOUBLE => Arc::new(Float64Array::from(array_data))
as ArrayRef,
- PhysicalType::INT96 => {
- Arc::new(TimestampNanosecondArray::from(array_data)) as
ArrayRef
- }
+ let array: ArrayRef = match T::get_physical_type() {
+ PhysicalType::BOOLEAN => Arc::new(BooleanArray::from(array_data)),
+ PhysicalType::INT32 => match array_data.data_type() {
+ ArrowType::UInt32 => Arc::new(UInt32Array::from(array_data)),
Review Comment:
is this a bug fix? Seems like a good improvement to me
##########
arrow-array/src/array/boolean_array.rs:
##########
@@ -201,6 +201,13 @@ impl From<Vec<Option<bool>>> for BooleanArray {
impl From<ArrayData> for BooleanArray {
fn from(data: ArrayData) -> Self {
+ assert_eq!(
+ data.data_type(),
+ &DataType::Boolean,
+ "BooleanArray expected ArrayData with type {} got {}",
Review Comment:
👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]