Skip to content

Commit 2960e68

Browse files
committed
fix: adjust filter threshold based on ptype width
Signed-off-by: Alexander Droste <[email protected]>
1 parent 2867ec0 commit 2960e68

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,20 @@ impl LayoutReader for FlatReader {
156156
array = array.slice(row_range.clone());
157157
}
158158

159+
let use_filter = |dtype: &DType| match dtype {
160+
DType::Primitive(ptype, _) => {
161+
let threshold = match ptype.byte_width() {
162+
1 | 2 => 0.03,
163+
4 => 0.075,
164+
_ => 0.09,
165+
};
166+
mask.density() < threshold
167+
}
168+
_ => mask.density() < FILTER_OF_FILTER_THRESHOLD,
169+
};
170+
159171
let array_mask = if *USE_VORTEX_OPERATORS {
160-
if mask.density() < FILTER_OF_FILTER_THRESHOLD {
172+
if use_filter(array.dtype()) {
161173
// Run only over the pre-filtered rows.
162174
let array = array.filter(mask.clone())?;
163175
let array = array.apply(&expr)?;

0 commit comments

Comments
 (0)