Skip to content

Commit 6d3f02b

Browse files
committed
fix: guard new filter ops (not_in, like, not_like, not_between) from WASM-only paths
scanFilterIndices and canUseWasmAggregate now correctly exclude the new filter ops from WASM SIMD paths that only handle scalar numeric comparisons. These ops fall through to the JS evaluation fallback.
1 parent bac3d88 commit 6d3f02b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/operators.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ function scanFilterIndices(
333333
return new Uint32Array(0);
334334
}
335335

336-
const wasmOp = filter.op !== "in" && filter.op !== "between" ? filterOpToWasm(filter.op) : -1;
336+
const isCompoundOp = filter.op === "in" || filter.op === "not_in" || filter.op === "between" || filter.op === "not_between" || filter.op === "like" || filter.op === "not_like";
337+
const wasmOp = !isCompoundOp ? filterOpToWasm(filter.op) : -1;
337338

338339
// Try WASM SIMD path for numeric scalar filters
339340
if (wasmOp >= 0 && typeof filter.value === "number" &&
@@ -1311,7 +1312,7 @@ export function canUseWasmAggregate(query: QueryDescriptor, columns: ColumnMeta[
13111312

13121313
// Filters are allowed if they are on numeric columns with scalar/range ops
13131314
for (const f of query.filters) {
1314-
if (f.op === "in" || f.op === "is_null" || f.op === "is_not_null") return false;
1315+
if (f.op === "in" || f.op === "not_in" || f.op === "like" || f.op === "not_like" || f.op === "is_null" || f.op === "is_not_null") return false;
13151316
const fc = colMap.get(f.column);
13161317
if (!fc) return false;
13171318
if (fc.dtype !== "float64" && fc.dtype !== "int32" && fc.dtype !== "int64") return false;

0 commit comments

Comments
 (0)