Repository navigation
feat: add validate_fragments for distributed fragment validation - #88
hello-peter-tang wants to merge 1 commit into
Conversation
Add `daft_lance.validate_fragments`, a read-only operation that validates selected Lance fragments without scanning rows. The driver resolves one dataset version and enumerates fragment metadata; Daft workers reopen that pinned snapshot through the existing DatasetOpenContext and call Lance's native LanceFragment.validate(), so validation runs with bounded concurrency on local and distributed runners. The returned DataFrame has one row per selected fragment with version, fragment_id, valid and error. Worker open/authentication failures carry a distinct prefix so they are not reported as corruption. Unknown fragment IDs and empty selections raise ValueError; the dataset version never changes. Reuses Lance's validator rather than reimplementing one. Closes daft-engine#63.
|
Heads-up: the |
|
CI for this branch is still parked in
Environment: Linux x86_64, Python 3.11.6, deps installed from the committed |
Summary
Adds
daft_lance.validate_fragments, a read-only operation that validates selected Lance fragments without scanning table rows, closing the integration gap in #63.Planning happens on the driver: it opens the requested snapshot (or
version=/asof=), enumerates fragment metadata from the pinned manifest, and validates the requested subset of fragment IDs. Execution happens on Daft workers, which reopen that exact pinned snapshot through the existingDatasetOpenContextand call Lance's nativeLanceFragment.validate()with bounded concurrency. This reuses Lance's validator rather than implementing a second one, so fragment file/metadata and deletion-vector consistency checks stay upstream.API
The returned DataFrame has one row per selected fragment:
versionfragment_idvaliderrorBehaviour:
failed to open the dataset at version ...prefix, distinct from detected fragment corruption.ValueError; duplicates are ignored;fragment_ids=Nonevalidates every fragment in the pinned manifest.PyLance requirement:
LanceFragment.validate()needs PyLance >= 11. The package already requires >= 12, so the floor is unchanged; this is documented on the public function.Tests
New
tests/io/lance/test_fragment_validation.py(13 tests) covers:add_columnsenrichment);version=validation;dirnamespace-addressed table reopening on workers;Closes #63