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

Commit

Permalink
Improved API
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Aug 10, 2022
1 parent ffda4f1 commit b5f2067
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 199 deletions.
1 change: 1 addition & 0 deletions src/io/ipc/read/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub mod stream_async;
pub mod file_async;

pub(crate) use common::first_dict_field;
#[cfg(feature = "io_flight")]
pub(crate) use common::{read_dictionary, read_record_batch};
pub use file::{read_batch, read_file_dictionaries, read_file_metadata, FileMetadata};
pub use reader::FileReader;
Expand Down
9 changes: 4 additions & 5 deletions src/io/parquet/read/indexes/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ use crate::{
trusted_len::TrustedLen,
};

use super::ColumnIndex;
use super::ColumnPageStatistics;

pub fn deserialize(
indexes: &[PageIndex<Vec<u8>>],
data_type: &DataType,
) -> Result<ColumnIndex, Error> {
Ok(ColumnIndex {
) -> Result<ColumnPageStatistics, Error> {
Ok(ColumnPageStatistics {
min: deserialize_binary_iter(indexes.iter().map(|index| index.min.as_ref()), data_type)?,
max: deserialize_binary_iter(indexes.iter().map(|index| index.max.as_ref()), data_type)?,
null_count: PrimitiveArray::from_trusted_len_iter(
indexes
.iter()
.map(|index| index.null_count.map(|x| x as u64)),
)
.boxed(),
),
})
}

Expand Down
9 changes: 4 additions & 5 deletions src/io/parquet/read/indexes/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use parquet2::indexes::PageIndex;

use crate::array::{BooleanArray, PrimitiveArray};

use super::ColumnIndex;
use super::ColumnPageStatistics;

pub fn deserialize(indexes: &[PageIndex<bool>]) -> ColumnIndex {
ColumnIndex {
pub fn deserialize(indexes: &[PageIndex<bool>]) -> ColumnPageStatistics {
ColumnPageStatistics {
min: Box::new(BooleanArray::from_trusted_len_iter(
indexes.iter().map(|index| index.min),
)),
Expand All @@ -16,7 +16,6 @@ pub fn deserialize(indexes: &[PageIndex<bool>]) -> ColumnIndex {
indexes
.iter()
.map(|index| index.null_count.map(|x| x as u64)),
)
.boxed(),
),
}
}
9 changes: 4 additions & 5 deletions src/io/parquet/read/indexes/fixed_len_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use crate::{
trusted_len::TrustedLen,
};

use super::ColumnIndex;
use super::ColumnPageStatistics;

pub fn deserialize(indexes: &[PageIndex<Vec<u8>>], data_type: DataType) -> ColumnIndex {
ColumnIndex {
pub fn deserialize(indexes: &[PageIndex<Vec<u8>>], data_type: DataType) -> ColumnPageStatistics {
ColumnPageStatistics {
min: deserialize_binary_iter(
indexes.iter().map(|index| index.min.as_ref()),
data_type.clone(),
Expand All @@ -19,8 +19,7 @@ pub fn deserialize(indexes: &[PageIndex<Vec<u8>>], data_type: DataType) -> Colum
indexes
.iter()
.map(|index| index.null_count.map(|x| x as u64)),
)
.boxed(),
),
}
}

Expand Down
Loading

0 comments on commit b5f2067

Please sign in to comment.