Skip to content

Delta Lake export: LEFT JOIN the segmentation table - #279

Open
bdpedigo wants to merge 2 commits into
masterfrom
deltalake-export-left-join
Open

bdpedigo wants to merge 2 commits into
masterfrom
deltalake-export-left-join

Conversation

@bdpedigo

Copy link
Copy Markdown
Contributor

Closes #275.

Cherry-picks 83bfb70 from `deltalake-version-export` onto `master`.

The Delta Lake exporter joined the annotation table to its segmentation table with an inner join. An annotation with no segmentation row was dropped from the export. The query API's `QueryManager` uses a LEFT JOIN and keeps such rows with null supervoxel and root ids, and `MaterializedMetadata` counts them. This change makes the exporter use a LEFT JOIN in `TableSource.from_clause` and in the `row_limit` path of `stream_table_to_arrow`.

Tests: updates the `TableSource` assertion and adds `TestStreamKeepsAnnotationsWithoutSegmentation`, which runs against Postgres.

🤖 Generated with Claude Code

… does

An annotation whose supervoxel lookup produced no segmentation row is still a
row of the table: QueryManager's LEFT JOIN returns it with null ids, and
MaterializedMetadata counts it. The exporter's inner join dropped such rows
silently. The new catalog row-count check caught it on ltv7 v2253, where
spine_bigger_test_4 lost 247 of its 1,499,995 rows in all three lakes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runner's pg_dump (17+) writes SET transaction_timeout, which a
Postgres 13 server rejects. The --single-transaction psql import then
aborts and test_clustered_staging_table_transfers_in_id_order sees 0
rows. The production image installs postgresql-client-18.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use a left join between base and segmentation table during delta lake exports

3 participants