Skip to content

Commit 326c875

Browse files
committed
fix
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent 5080813 commit 326c875

5 files changed

Lines changed: 21 additions & 23 deletions

File tree

encodings/sequence/src/array.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -519,12 +519,12 @@ mod tests {
519519
let is_sorted = arr
520520
.statistics()
521521
.with_typed_stats_set(|s| s.get_as::<bool>(Stat::IsSorted));
522-
assert_eq!(is_sorted, Some(StatPrecision::Exact(true)));
522+
assert_eq!(is_sorted, StatPrecision::Exact(true));
523523

524524
let is_strict_sorted = arr
525525
.statistics()
526526
.with_typed_stats_set(|s| s.get_as::<bool>(Stat::IsStrictSorted));
527-
assert_eq!(is_strict_sorted, Some(StatPrecision::Exact(true)));
527+
assert_eq!(is_strict_sorted, StatPrecision::Exact(true));
528528
Ok(())
529529
}
530530

@@ -535,12 +535,12 @@ mod tests {
535535
let is_sorted = arr
536536
.statistics()
537537
.with_typed_stats_set(|s| s.get_as::<bool>(Stat::IsSorted));
538-
assert_eq!(is_sorted, Some(StatPrecision::Exact(true)));
538+
assert_eq!(is_sorted, StatPrecision::Exact(true));
539539

540540
let is_strict_sorted = arr
541541
.statistics()
542542
.with_typed_stats_set(|s| s.get_as::<bool>(Stat::IsStrictSorted));
543-
assert_eq!(is_strict_sorted, Some(StatPrecision::Exact(false)));
543+
assert_eq!(is_strict_sorted, StatPrecision::Exact(false));
544544
Ok(())
545545
}
546546

@@ -551,12 +551,12 @@ mod tests {
551551
let is_sorted = arr
552552
.statistics()
553553
.with_typed_stats_set(|s| s.get_as::<bool>(Stat::IsSorted));
554-
assert_eq!(is_sorted, Some(StatPrecision::Exact(false)));
554+
assert_eq!(is_sorted, StatPrecision::Exact(false));
555555

556556
let is_strict_sorted = arr
557557
.statistics()
558558
.with_typed_stats_set(|s| s.get_as::<bool>(Stat::IsStrictSorted));
559-
assert_eq!(is_strict_sorted, Some(StatPrecision::Exact(false)));
559+
assert_eq!(is_strict_sorted, StatPrecision::Exact(false));
560560
Ok(())
561561
}
562562

@@ -575,8 +575,8 @@ mod tests {
575575
.statistics()
576576
.with_typed_stats_set(|s| s.get_as::<bool>(Stat::IsStrictSorted));
577577

578-
assert_eq!(is_sorted, Some(StatPrecision::Exact(true)));
579-
assert_eq!(is_strict_sorted, Some(StatPrecision::Exact(true)));
578+
assert_eq!(is_sorted, StatPrecision::Exact(true));
579+
assert_eq!(is_strict_sorted, StatPrecision::Exact(true));
580580

581581
Ok(())
582582
}

encodings/zstd/src/zstd_buffers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ mod tests {
563563

564564
let compressed = ZstdBuffers::compress(&input, 3, &LEGACY_SESSION)?;
565565

566-
assert!(compressed.statistics().get(Stat::Min).is_some());
566+
assert!(!compressed.statistics().get(Stat::Min).is_absent());
567567
Ok(())
568568
}
569569

vortex-btrblocks/src/schemes/integer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,15 +1193,15 @@ mod scheme_selection_tests {
11931193
assert!(compressed.is::<BitPacked>());
11941194
assert_eq!(
11951195
compressed.statistics().get_as::<u64>(Stat::NullCount),
1196-
Some(Precision::exact(0u64))
1196+
Precision::exact(0u64)
11971197
);
11981198
assert_eq!(
11991199
compressed.statistics().get_as::<u32>(Stat::Min),
1200-
Some(Precision::exact(0u32))
1200+
Precision::exact(0u32)
12011201
);
12021202
assert_eq!(
12031203
compressed.statistics().get_as::<u32>(Stat::Max),
1204-
Some(Precision::exact(15u32))
1204+
Precision::exact(15u32)
12051205
);
12061206
Ok(())
12071207
}

vortex-duckdb/src/datasource.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,16 @@ pub struct ColumnStatisticsAggregate {
230230
impl ColumnStatisticsAggregate {
231231
pub fn new(stats: &StatsSet) -> Self {
232232
let min = match stats.get(Stat::Min) {
233-
Some(Precision::Exact(min)) => Some(min),
233+
Precision::Exact(min) => Some(min),
234234
_ => None,
235235
};
236236
let max = match stats.get(Stat::Max) {
237-
Some(Precision::Exact(max)) => Some(max),
237+
Precision::Exact(max) => Some(max),
238238
_ => None,
239239
};
240240

241241
let max_string_length =
242-
if let Some(Precision::Exact(value)) = stats.get(Stat::UncompressedSizeInBytes) {
242+
if let Precision::Exact(value) = stats.get(Stat::UncompressedSizeInBytes) {
243243
// DuckDB's string length is u32
244244
#[allow(clippy::cast_possible_truncation)]
245245
Some(value.as_primitive().as_u64().vortex_expect("not a u64") as u32)
@@ -248,9 +248,7 @@ impl ColumnStatisticsAggregate {
248248
};
249249

250250
let has_null = match stats.get(Stat::NullCount) {
251-
Some(Precision::Exact(cnt)) => {
252-
cnt.as_primitive().as_u64().vortex_expect("not a u64") > 0
253-
}
251+
Precision::Exact(cnt) => cnt.as_primitive().as_u64().vortex_expect("not a u64") > 0,
254252
_ => true,
255253
};
256254

vortex-layout/src/layouts/flat/writer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ mod tests {
273273

274274
assert_eq!(
275275
result.statistics().get_as::<bool>(Stat::IsSorted),
276-
Some(Precision::Exact(true))
276+
Precision::Exact(true)
277277
);
278278
})
279279
}
@@ -325,16 +325,16 @@ mod tests {
325325
assert_eq!(
326326
result.statistics().get_as::<String>(Stat::Min),
327327
// The typo is correct, we need this to be truncated.
328-
Some(Precision::Inexact(
328+
Precision::Inexact(
329329
// spellchecker:ignore-next-line
330330
"Another string that's meant to be smaller than the previous valu".to_string()
331-
))
331+
)
332332
);
333333
assert_eq!(
334334
result.statistics().get_as::<String>(Stat::Max),
335-
Some(Precision::Inexact(
335+
Precision::Inexact(
336336
"Long value to test that the statistics are actually truncated, j".to_string()
337-
))
337+
)
338338
);
339339
})
340340
}

0 commit comments

Comments
 (0)