Skip to content

Commit caf5205

Browse files
committed
fix: subqueryIn null values used "__null__" instead of NULL_SENTINEL
client.ts stored null subquery values as "__null__" but SubqueryInOperator matches with NULL_SENTINEL — null values silently never matched. Also fixed same pattern in index.ts partition grouping for consistency.
1 parent 470b86a commit caf5205

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import type {
1515
VectorSearchParams,
1616
WindowSpec,
1717
} from "./types.js";
18+
import { NULL_SENTINEL } from "./types.js";
1819
import type { Operator, RowBatch } from "./operators.js";
1920
import { rowPassesFilters } from "./decode.js";
2021
import { computePartialAgg, finalizePartialAgg } from "./partial-agg.js";
@@ -466,7 +467,7 @@ export class DataFrame<T extends Row = Row> {
466467
const col = cols[0];
467468
if (col) {
468469
const val = row[col];
469-
valueSet.add(val === null ? "__null__" : typeof val === "bigint" ? val.toString() : String(val));
470+
valueSet.add(val === null || val === undefined ? NULL_SENTINEL : typeof val === "bigint" ? val.toString() : String(val));
470471
}
471472
}
472473
resolved.push({ column: deferred.column, valueSet });

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { DataFrame, TableQuery } from "./client.js";
22
import type { QueryDescriptor, QueryExecutor } from "./client.js";
33
import type { AppendOptions, AppendResult, DropResult, ExplainResult, QueryResult, Row, QueryDORpc, MasterDORpc } from "./types.js";
4+
import { NULL_SENTINEL } from "./types.js";
45
import { LocalExecutor } from "./local-executor.js";
56
import { createFromJSON, createFromCSV, createDemo } from "./convenience.js";
67
import { sqlToDescriptor, buildSqlDataFrame } from "./sql/index.js";
@@ -207,7 +208,7 @@ class RemoteExecutor implements QueryExecutor {
207208
const partCol = options.partitionBy;
208209
const groups = new Map<string, Record<string, unknown>[]>();
209210
for (const row of rows) {
210-
const key = row[partCol] === null || row[partCol] === undefined ? "__null__" : String(row[partCol]);
211+
const key = row[partCol] === null || row[partCol] === undefined ? NULL_SENTINEL : String(row[partCol]);
211212
let group = groups.get(key);
212213
if (!group) { group = []; groups.set(key, group); }
213214
group.push(row);

0 commit comments

Comments
 (0)