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

Commit

Permalink
fix(parquet): enforce to use for PhysicalType::Int96
Browse files Browse the repository at this point in the history
  • Loading branch information
sundy-li committed Jul 18, 2022
1 parent 3fdb33f commit 7a5a3f9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/io/parquet/read/deserialize/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,11 @@ fn timestamp<'a, I: 'a + DataPages>(
) -> Result<ArrayIter<'a>> {
if physical_type == &PhysicalType::Int96 {
let iter = primitive::Iter::new(pages, data_type, chunk_size, int96_to_i64_ns);

let (factor, is_multiplier) = unifiy_timestmap_unit(logical_type, time_unit);
let logical_type = PrimitiveLogicalType::Timestamp {
unit: ParquetTimeUnit::Nanoseconds,
is_adjusted_to_utc: false,
};
let (factor, is_multiplier) = unifiy_timestmap_unit(&Some(logical_type), time_unit);
return match (factor, is_multiplier) {
(1, _) => Ok(dyn_iter(iden(iter))),
(a, true) => Ok(dyn_iter(op(iter, move |x| x * a))),
Expand Down Expand Up @@ -353,7 +356,11 @@ fn timestamp_dict<'a, K: DictionaryKey, I: 'a + DataPages>(
time_unit: TimeUnit,
) -> Result<ArrayIter<'a>> {
if physical_type == &PhysicalType::Int96 {
let (factor, is_multiplier) = unifiy_timestmap_unit(logical_type, time_unit);
let logical_type = PrimitiveLogicalType::Timestamp {
unit: ParquetTimeUnit::Nanoseconds,
is_adjusted_to_utc: false,
};
let (factor, is_multiplier) = unifiy_timestmap_unit(&Some(logical_type), time_unit);
return match (factor, is_multiplier) {
(a, true) => Ok(dyn_iter(primitive::DictIter::<K, _, _, _, _>::new(
pages,
Expand Down

0 comments on commit 7a5a3f9

Please sign in to comment.