Skip to content

feat(duckdb): add distributed scan fragments - #6

Open
kaka11chen wants to merge 4 commits into
duckdb/v1.5-variegata_vanefrom
feat/vortex-scan-fragments
Open

feat(duckdb): add distributed scan fragments#6
kaka11chen wants to merge 4 commits into
duckdb/v1.5-variegata_vanefrom
feat/vortex-scan-fragments

Conversation

@kaka11chen

Copy link
Copy Markdown

Rationale for this change

Vane distributed Vortex scans currently schedule one complete file per split, so one large file cannot use multiple workers. This change turns stable root-coordinate ranges from the existing Vortex split API into independently reopenable worker fragments while retaining immutable object identity checks.

What changes are included in this PR?

  • Add a generic deferred multi-layout scan constructor with an assigned root row range per child.
  • Plan deterministic fragment counts from natural Vortex ranges, coalesce them without gaps or overlap, and produce exact row plus proportional byte estimates.
  • Add Vane-only fragment planning/runtime FFI and a vane.vortex-file-fragment-split payload carrying file identity, row bounds, and estimates.
  • Validate canonical ordering, overlap, immutable file identity, aggregate complete sets, and idempotent split replay before execution.
  • Keep aggregate pushdown as one complete-set split containing one full-range fragment per eligible file.

Validation:

  • cargo test --locked -p vortex-layout -p vortex-duckdb --all-features
  • cargo clippy --locked -p vortex-layout -p vortex-duckdb --all-targets --all-features -- -D warnings
  • VORTEX_VANE_DISTRIBUTED=1 cargo check --locked -p vortex-duckdb --all-targets --all-features against AstroVela/vane 67b68a96
  • nightly rustfmt, clang-format 18, and git diff --check

What APIs are changed? Are there any user-facing changes?

MultiLayoutDataSource::new_deferred_ranges is a new generic API for independently assigned child ranges. The fragment FFI and DuckDB table-function behavior are compiled only with VORTEX_VANE_DISTRIBUTED; the native DuckDB extension path keeps its existing behavior.

This project-stage protocol update deliberately replaces the previous file-split representation. VORTEX_BIND_SERDE_VERSION and VORTEX_SPLIT_PAYLOAD_VERSION remain 1; no legacy codec compatibility or fallback is added.

Signed-off-by: kaka11chen <kaka11.chen@gmail.com>
Copilot AI lite review requested due to automatic review settings September 1, 2026 08:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T09:35:28.147469Z ac245e1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kaka11chen

Copy link
Copy Markdown
Author

External GitHub review round 1 on final head 140a58c390:

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 140a58c390

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vortex-duckdb/src/distributed.rs Outdated
Signed-off-by: kaka11chen <kaka11.chen@gmail.com>
@kaka11chen

Copy link
Copy Markdown
Author

External GitHub review round 1 after the bounded-concurrency fix on final head c4e4742ca7:

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4e4742ca7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vortex-duckdb/cpp/table_function.cpp
@kaka11chen

Copy link
Copy Markdown
Author

External GitHub clean review round 1 on unchanged head c4e4742ca7 after resolving all findings. Please apply the documented project-stage constraint: cross-version persisted plans and rolling coordinator/worker compatibility are out of scope, so the bind serde version intentionally remains 1 with no migration or fallback.

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

This PR enables distributed Vortex scans to split large files into independently reopenable row-range fragments, allowing parallel work across multiple workers while preserving immutable file identity checks.

Changes:

  • Add MultiLayoutDataSource::new_deferred_ranges and propagate optional per-child root row ranges through the scan pipeline.
  • Introduce deterministic fragment planning (coalescing natural Vortex ranges, estimating bytes/rows) and validate canonical ordering/overlap/idempotency.
  • Update Vane distributed FFI + split payload protocol and C++ table-function logic to pass fragment assignments instead of file indexes.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
vortex-layout/src/scan/multi.rs Adds per-child assigned row ranges, new deferred-range constructor, and range-aware partition creation + tests.
vortex-duckdb/src/multi_file.rs Adds fragment-scan builder over bound files using deferred assigned ranges.
vortex-duckdb/src/ffi.rs Extends distributed FFI to plan fragments and pass fragment views into global init.
vortex-duckdb/src/distributed.rs Implements fragment planning, natural split validation, byte estimation, and runtime-bind validation; adds unit tests for helper logic.
vortex-duckdb/include/vortex.h Adds C ABI definition for VortexDistributedFragmentView and new fragment-planning/inspection APIs.
vortex-duckdb/cpp/table_function.cpp Switches distributed split payload from file-based to fragment-based; updates planning/application/serialization and validation.
vortex-duckdb/cpp/include/table_function.hpp Adds DistributedFragment and stores assigned fragments in bind data.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread vortex-duckdb/cpp/table_function.cpp
Comment thread vortex-duckdb/cpp/table_function.cpp
Comment thread vortex-duckdb/cpp/table_function.cpp
Comment thread vortex-duckdb/cpp/table_function.cpp Outdated
Comment thread vortex-duckdb/src/distributed.rs
Comment thread vortex-duckdb/src/distributed.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4e4742ca7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vortex-duckdb/cpp/table_function.cpp Outdated
Signed-off-by: kaka11chen <kaka11.chen@gmail.com>
Signed-off-by: kaka11chen <kaka11.chen@gmail.com>
@kaka11chen

Copy link
Copy Markdown
Author

External GitHub clean review round 1 on final head ac245e1. Please review the current head. Project-stage constraint: persisted cross-version plans, mixed coordinator/worker builds, migration, compatibility, and fallback are out of scope; VORTEX_BIND_SERDE_VERSION and the split payload version intentionally remain 1.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: ac245e198a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kaka11chen

Copy link
Copy Markdown
Author

External GitHub clean review round 2 on unchanged final head ac245e1. Round 1 completed on this head with no findings and no open review threads. Please perform an independent second review. Project-stage constraint remains: version stays 1, with no cross-version compatibility, migration, or fallback.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: ac245e198a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants