File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
vortex-layout/src/layouts/flat Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff 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) ?;
You can’t perform that action at this time.
0 commit comments