Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Small improvement to stats
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Feb 6, 2022
1 parent f02da8a commit 17a4af4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/io/parquet/read/statistics/fixlen.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::any::Any;
use std::convert::{TryFrom, TryInto};

use super::super::schema;
use super::primitive::PrimitiveStatistics;
use crate::datatypes::DataType;
use crate::error::{ArrowError, Result};
use parquet2::schema::types::ParquetType;
use parquet2::{
schema::types::PhysicalType,
statistics::{
Expand Down Expand Up @@ -102,10 +100,8 @@ impl TryFrom<(&ParquetFixedLenStatistics, DataType)> for PrimitiveStatistics<i12

pub(super) fn statistics_from_fix_len(
stats: &ParquetFixedLenStatistics,
type_: &ParquetType,
data_type: DataType,
) -> Result<Box<dyn Statistics>> {
let data_type = schema::to_data_type(type_)?.unwrap();

use DataType::*;
Ok(match data_type {
Decimal(_, _) => Box::new(PrimitiveStatistics::<i128>::try_from((stats, data_type))?),
Expand Down
2 changes: 1 addition & 1 deletion src/io/parquet/read/statistics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn _deserialize_statistics(
}
PhysicalType::FixedLenByteArray(_) => {
let stats = stats.as_any().downcast_ref().unwrap();
fixlen::statistics_from_fix_len(stats, stats.descriptor.type_())
fixlen::statistics_from_fix_len(stats, data_type)
}
_ => Err(ArrowError::NotYetImplemented(
"Reading Fixed-len array statistics is not yet supported".to_string(),
Expand Down

0 comments on commit 17a4af4

Please sign in to comment.