Latest Results
fix: fix column not found when using count_rows() for sparse data (#6703)
## Changes Made
followup https://github.com/Eventual-Inc/Daft/pull/5681
<!-- Describe what changes were made and why. Include implementation
details if necessary. -->
Previously, the issue of missing fields in sparse data was resolved at
the plan level for APIs such as collect() and show(). However, the
count_rows() API still suffered from the same problem during the
physical execution path for local files. Specifically, when calling
count_rows() on a DataFrame that includes a filter on a missing field
(e.g., where("sound is null")), the operation failed with a
FieldNotFound error because the schema did not contain the required
column.
```
daft.read_json('/mnt/test/vedio.audio-00002.jsonl')
.where("sound is null")
.count_rows()
```
```
DaftError::FieldNotFound Column "sound" not found in schema: [Field { name: "video_meta", dtype: Struct(...), metadata: {} }]
```
The current modification extends the field completion logic to the
physical execution path of count_rows(), ensuring that missing fields
are properly filled before counting rows. This aligns the behavior of
count_rows() with that of collect() and show().
## Related Issues
<!-- Link to related GitHub issues, e.g., "Closes #123" --> Latest Branches
0%
everettVT/hf-storage-buckets +11%
BABTUNA:feat/show-query-id-cli 0%
gavin9402:introduce_file_resource Ā© 2026 CodSpeed Technology