Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
samster25 committed Oct 11, 2023
1 parent 3e485cf commit d5d1237
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 30 deletions.
39 changes: 11 additions & 28 deletions src/daft-micropartition/src/column_stats/from_parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,26 +224,16 @@ impl TryFrom<&FixedLenStatistics> for ColumnRangeStatistics {

if let Some(ltype) = ptype.logical_type {
use parquet2::schema::types::PrimitiveLogicalType;
match ltype {
PrimitiveLogicalType::Decimal(p, s) => {
return make_decimal_column_range_statistics(
p,
s,
lower.as_slice(),
upper.as_slice(),
)
}
_ => {} // fall back
}
} else if let Some(ctype) = ptype.converted_type {
if let PrimitiveConvertedType::Decimal(p, s) = ctype {
if let PrimitiveLogicalType::Decimal(p, s) = ltype {
return make_decimal_column_range_statistics(
p,
s,
lower.as_slice(),
upper.as_slice(),
);
}
} else if let Some(PrimitiveConvertedType::Decimal(p, s)) = ptype.converted_type {
return make_decimal_column_range_statistics(p, s, lower.as_slice(), upper.as_slice());
}

let lower = BinaryArray::from(("lower", lower.as_slice())).into_series();
Expand Down Expand Up @@ -363,21 +353,14 @@ fn convert_int96_column_range_statistics(

if let Some(ltype) = prim_type.logical_type {
use parquet2::schema::types::PrimitiveLogicalType;
match ltype {
PrimitiveLogicalType::Timestamp {
unit,
is_adjusted_to_utc,
} => {
let lower = convert_i96_to_i64_timestamp(lower, unit);
let upper = convert_i96_to_i64_timestamp(upper, unit);
return make_timestamp_column_range_statistics(
unit,
is_adjusted_to_utc,
lower,
upper,
);
}
_ => {}
if let PrimitiveLogicalType::Timestamp {
unit,
is_adjusted_to_utc,
} = ltype
{
let lower = convert_i96_to_i64_timestamp(lower, unit);
let upper = convert_i96_to_i64_timestamp(upper, unit);
return make_timestamp_column_range_statistics(unit, is_adjusted_to_utc, lower, upper);
}
} else if let Some(ctype) = prim_type.converted_type {
match ctype {
Expand Down
2 changes: 1 addition & 1 deletion src/daft-micropartition/src/micropartition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use daft_dsl::Expr;
use daft_parquet::read::read_parquet_metadata;
use daft_table::Table;

use snafu::{OptionExt, ResultExt};
use snafu::ResultExt;

use crate::DaftCoreComputeSnafu;

Expand Down
2 changes: 1 addition & 1 deletion src/daft-micropartition/src/table_stats/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ops::Not;
use daft_dsl::Expr;
use daft_table::Table;
use indexmap::IndexMap;
use snafu::{OptionExt, ResultExt};
use snafu::ResultExt;

use crate::column_stats::{self, ColumnRangeStatistics};

Expand Down

0 comments on commit d5d1237

Please sign in to comment.