Skip to content

Commit aca8e1d

Browse files
committed
docs: add null handling section to write-path page
Documents that null/undefined values are preserved via validity bitmap in the Lance fragment, not silently coerced to 0/"". Includes example showing IS NULL filter on appended data.
1 parent cd6e704 commit aca8e1d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/src/content/docs/write-path.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,25 @@ The partition catalog is built automatically during ingest (when `partitionBy` i
6464

6565
For tables ingested without `partitionBy`, QueryMode auto-detects the best partition column from page-level min/max stats on the first multi-fragment query. Auto-detection uses ratio-based scoring to pick columns with good cardinality (e.g., `region` with 50 values) over near-unique columns (e.g., `timestamp` with 10K values).
6666

67+
## Null handling
68+
69+
Null and undefined values are preserved through the write path. Each column that contains nulls gets a validity bitmap in the Lance fragment — nulls are **not** silently coerced to 0 or empty string.
70+
71+
```typescript
72+
await qm.table("users").append([
73+
{ id: 1, name: "Alice", score: 95 },
74+
{ id: 2, name: "Bob", score: null }, // score stored as null
75+
{ id: 3, name: null, score: 80 }, // name stored as null
76+
])
77+
78+
const result = await qm.table("users")
79+
.filter("score", "is_null")
80+
.collect()
81+
// [{ id: 2, name: "Bob", score: null }]
82+
```
83+
84+
Type inference uses the first non-null value per column. Columns where **all** values are null are skipped (no type to infer).
85+
6786
## Drop tables
6887

6988
Delete a table — removes all Lance fragments from R2 and clears DO metadata:

0 commit comments

Comments
 (0)