Skip to content

[core] Support configured data directories throughout table IO - #974

Merged
JingsongLi merged 2 commits into
apache:mainfrom
JingsongLi:codex/native-read-completion
Sep 28, 2026
Merged

JingsongLi merged 2 commits into
apache:mainfrom
JingsongLi:codex/native-read-completion

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

Purpose

Support data-file.path-directory throughout Paimon table IO so PyPaimon can use Native planning, reading, writing, updating, and committing for tables with a configured data directory.

Previously, Rust built bucket paths directly under the table root. Using Native IO could therefore fail to find existing files or write files into a different layout from Java/Python.

Brief change log

  • Resolve relative, normalized, absolute, and URI data directories using Java Path semantics, including Windows drives and UNC paths.
  • Use the shared data root for append/PK/changelog/Blob writers, scans, managed Blob packs, update/delete paths, abort cleanup, dynamic-bucket hash indexes, and global-index source reads.
  • Preserve the explicit relative bucket path for external deletion vectors instead of assuming every bucket lives under the table root.
  • Make physical/referenced file statistics aware of relocated data and sidecar files, including directories outside the table root.
  • Reject an empty directory and preserve the stored layout during table copies and catalog option changes. Catalog alterations use the existing index-layout immutability rule, including before the first snapshot, to avoid stranding an already-created writer.
  • Add end-to-end coverage for relocated files, updates/upserts, repeated deletes, history, cleanup, Blob payloads, dynamic buckets, and sidecar statistics.

Tests

  • 35 integration tests passed: data_file_directory_test, table_update_paths_test, and table_update_test.
  • 76 focused unit tests passed: partition/path utilities, directory immutability, external paths, referenced/physical statistics, dynamic bucket assignment, and index paths.
  • cargo clippy --locked --all-targets --workspace --features fulltext,vortex -- -D warnings passed.
  • cargo fmt --all --check passed.
  • Built the Python binding locally and ran the companion PyPaimon Native regression selection with all five Native CI flags: 1368 passed, 2 skipped, and 62 subtests passed (PyArrow 18.1).

API and Format

Adds a CoreOptions accessor and options-aware file-statistics entry points. Existing statistics entry points retain their default-directory behavior. No file-format or manifest-format changes; schema, snapshot, manifest, and table-level index metadata remain rooted at the table location.

Documentation

Includes API documentation and Java-derived path expectations in regression tests. The option already exists in Java/PyPaimon.

@leaves12138 leaves12138 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.

Reviewed commit 2a46e49fe7433165bf066c1e4c6abac8cf3cec60 together with apache/paimon#10249.

Fixed and pushed the findings from this review:

  • Preserve the ./ prefix when normalization exposes a colon in the first relative path component. Windows must not reinterpret that component as a drive root; this fixes the previous Windows unit-test failure.
  • Preserve an empty path when a child such as . or x/.. resolves against a scheme/authority-only parent, matching Java Path instead of introducing an extra slash.
  • Added common and explicit Windows-mode regression cases, including Windows-mode coverage runnable on Linux.

Validation of this revision:

  • cargo test --locked -p paimon --lib: 3,410 passed, 6 ignored.
  • data_file_directory_test, table_update_paths_test, and table_update_test: 35 passed.
  • cargo fmt --all -- --check: passed.
  • Built the Python native extension from this exact Rust revision and tested it with the paired Python changes: 1,748 passed, 4 skipped, and 143 subtests passed with PyArrow 18.1.0 and native planning/reading/writing/updating/committing enabled.

No remaining blocking code-review findings for the paired revisions. The new cross-platform CI run is still in progress; this approval does not replace the required CI checks. LGTM.

@JingsongLi
JingsongLi merged commit b8fbc1c into apache:main Sep 28, 2026
14 checks passed
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.

2 participants