Skip to content

Commit 12f4b8f

Browse files
committed
Format prepared membership probes and tests
Signed-off-by: "Robert Kruszewski" <github@robertk.io>
1 parent ef539c9 commit 12f4b8f

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

‎vortex-array/src/scalar_fn/fns/list_contains/prepared/mod.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ impl PreparedSet {
210210
collect_bits(
211211
&values,
212212
|value| {
213-
value.offset_from(min).is_some_and(|offset| {
214-
offset < bitmap.len() && bitmap.value(offset)
215-
})
213+
value
214+
.offset_from(min)
215+
.is_some_and(|offset| offset < bitmap.len() && bitmap.value(offset))
216216
},
217217
ctx.allocator(),
218218
)

‎vortex-array/src/scalar_fn/fns/list_contains/prepared/tests.rs‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ use crate::validity::Validity;
3636

3737
fn nested_needles() -> ArrayRef {
3838
ListArray::try_new(
39-
PrimitiveArray::from_option_iter([Some(1i32), None, Some(2), None, Some(9)])
40-
.into_array(),
39+
PrimitiveArray::from_option_iter([Some(1i32), None, Some(2), None, Some(9)]).into_array(),
4140
buffer![0u32, 2, 2, 4, 5].into_array(),
4241
Validity::from(BitBuffer::from_iter([true, false, true, true])),
4342
)
@@ -132,8 +131,12 @@ fn test_row_set_returns_membership_bits(
132131
fn test_decimal_bitmap_across_storage_widths(
133132
#[values(2, 4, 9, 18, 38, 76)] precision: u8,
134133
#[values(
135-
DecimalType::I8, DecimalType::I16, DecimalType::I32,
136-
DecimalType::I64, DecimalType::I128, DecimalType::I256,
134+
DecimalType::I8,
135+
DecimalType::I16,
136+
DecimalType::I32,
137+
DecimalType::I64,
138+
DecimalType::I128,
139+
DecimalType::I256
137140
)]
138141
needle_width: DecimalType,
139142
#[values(false, true)] sql_null_semantics: bool,
@@ -145,16 +148,12 @@ fn test_decimal_bitmap_across_storage_widths(
145148
.map(|value| Scalar::decimal(value.into(), decimal, Nullability::Nullable))
146149
.into();
147150
elements.push(Scalar::null(dtype.clone()));
148-
let list = ConstantArray::new(
149-
Scalar::list(dtype, elements, Nullability::NonNullable),
150-
4,
151-
)
152-
.into_array();
151+
let list =
152+
ConstantArray::new(Scalar::list(dtype, elements, Nullability::NonNullable), 4).into_array();
153153
let needles = match_each_decimal_value_type!(needle_width, |T| {
154154
DecimalArray::from_option_iter::<T, _>(
155-
[Some(-2i8), Some(0), Some(1), None].map(|value| {
156-
value.map(|value| DecimalValue::from(value).cast::<T>().unwrap())
157-
}),
155+
[Some(-2i8), Some(0), Some(1), None]
156+
.map(|value| value.map(|value| DecimalValue::from(value).cast::<T>().unwrap())),
158157
decimal,
159158
)
160159
.into_array()
@@ -223,7 +222,12 @@ fn test_decimal_wide_values(
223222
assert_arrays_eq!(
224223
set.contains(&needles, &mut ctx)?,
225224
BoolArray::from_iter([
226-
Some(true), Some(true), Some(false), Some(false), Some(false), None,
225+
Some(true),
226+
Some(true),
227+
Some(false),
228+
Some(false),
229+
Some(false),
230+
None,
227231
]),
228232
&mut ctx
229233
);

0 commit comments

Comments
 (0)