Skip to content

Commit 6a0fe80

Browse files
committed
(fix) Disable decimals and remove code
Disable decimal support until values have a stable representation. See vortex-data#5820. Signed-off-by: Joaquin Colacci <[email protected]>
1 parent 2f20c0d commit 6a0fe80

4 files changed

Lines changed: 9 additions & 192 deletions

File tree

‎vortex-layout/src/layouts/zoned/aggregates/bloom_filter/canonical/decimal.rs‎

Lines changed: 0 additions & 165 deletions
This file was deleted.

‎vortex-layout/src/layouts/zoned/aggregates/bloom_filter/canonical/mod.rs‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ use vortex_error::VortexResult;
77
use vortex_error::vortex_bail;
88

99
mod bool;
10-
mod decimal;
1110
mod extension;
1211
mod primitive;
1312
mod varbin;
1413

1514
use bool::accumulate_bool;
16-
use decimal::accumulate_decimal;
1715
use extension::accumulate_extension;
1816
use primitive::accumulate_primitive;
1917
use varbin::accumulate_varbin;
@@ -28,15 +26,18 @@ pub(super) fn accumulate_canonical(
2826
match canonical {
2927
Canonical::Bool(array) => accumulate_bool(array, partial, ctx)?,
3028
Canonical::Primitive(array) => accumulate_primitive(array, partial, ctx)?,
31-
Canonical::Decimal(array) => accumulate_decimal(array, partial, ctx)?,
3229
Canonical::VarBinView(array) => accumulate_varbin(array, partial, ctx)?,
3330
Canonical::Extension(array) => accumulate_extension(array, partial, ctx)?,
34-
3531
// Nulls are skipped and are not included in any Bloom filter.
3632
Canonical::Null(_) => {}
3733

3834
// TODO (joacoc): pending canonical
39-
Canonical::Struct(_)
35+
//
36+
// TODO (joacoc): Add decimal support once the logical and physical type
37+
// mismatch is resolved:
38+
// <https://github.com/vortex-data/vortex/issues/5820>
39+
Canonical::Decimal(_)
40+
| Canonical::Struct(_)
4041
| Canonical::List(_)
4142
| Canonical::FixedSizeList(_)
4243
| Canonical::Variant(_)

‎vortex-layout/src/layouts/zoned/aggregates/bloom_filter/mod.rs‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,7 @@ impl AggregateFnVTable for BloomFilter {
223223
fn is_bloom_valid_dtype(dtype: &DType) -> bool {
224224
match dtype {
225225
DType::Extension(ext) => is_bloom_valid_dtype(ext.storage_dtype()),
226-
DType::Bool(_)
227-
| DType::Primitive(..)
228-
| DType::Decimal(..)
229-
| DType::Utf8(_)
230-
| DType::Binary(_) => true,
226+
DType::Bool(_) | DType::Primitive(..) | DType::Utf8(_) | DType::Binary(_) => true,
231227
_ => false,
232228
}
233229
}

‎vortex-layout/src/layouts/zoned/aggregates/bloom_filter/partial.rs‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use vortex_array::dtype::PType;
1515
use vortex_array::dtype::ToBytes;
1616
use vortex_array::match_each_float_ptype;
1717
use vortex_array::match_each_integer_ptype;
18-
use vortex_array::scalar::DecimalValue;
1918
use vortex_array::scalar::Scalar;
2019
use vortex_error::VortexExpect;
2120
use vortex_error::VortexResult;
@@ -212,20 +211,6 @@ impl BloomPartial {
212211
self.hash(value.to_le_bytes())
213212
}),
214213
},
215-
DType::Decimal(..) => {
216-
let decimal = scalar
217-
.as_decimal()
218-
.decimal_value()
219-
.vortex_expect("non-null decimal value");
220-
match decimal {
221-
DecimalValue::I8(v) => self.hash(v.to_le_bytes()),
222-
DecimalValue::I16(v) => self.hash(v.to_le_bytes()),
223-
DecimalValue::I32(v) => self.hash(v.to_le_bytes()),
224-
DecimalValue::I64(v) => self.hash(v.to_le_bytes()),
225-
DecimalValue::I128(v) => self.hash(v.to_le_bytes()),
226-
DecimalValue::I256(v) => self.hash(v.to_le_bytes()),
227-
}
228-
}
229214
DType::Utf8(_) => {
230215
let buffer = scalar
231216
.as_utf8()
@@ -398,7 +383,7 @@ mod tests {
398383
// A change in how hashes are calculated or how the block index is selected
399384
// could trigger this assertion, like a kind of smoke test.
400385
let options = BloomOptions::new(
401-
NonZeroU32::new(DEFAULT_BLOCKS_COUNT * 1000).expect("valid nonzero usize"),
386+
NonZeroU32::new(DEFAULT_BLOCKS_COUNT * 1000).expect("valid nonzero u32"),
402387
);
403388
let mut bloom_filter = BloomPartial::from(&options);
404389

@@ -417,7 +402,7 @@ mod tests {
417402
} else {
418403
assert!(
419404
!bloom_filter.contains(i.to_le_bytes()),
420-
"expected odd number {i} to not exist"
405+
"unexpected false positive for odd number {i}"
421406
);
422407
}
423408
}

0 commit comments

Comments
 (0)