Skip to content

feat(c): expose read builder scan options and time-travel through the C binding#524

Open
JunRuiLee wants to merge 4 commits into
apache:mainfrom
JunRuiLee:feat/c-binding-scan-mode
Open

feat(c): expose read builder scan options and time-travel through the C binding#524
JunRuiLee wants to merge 4 commits into
apache:mainfrom
JunRuiLee:feat/c-binding-scan-mode

Conversation

@JunRuiLee

Copy link
Copy Markdown
Contributor

Purpose

The C binding's paimon_table_new_read_builder took only the table — there was no channel to pass a per-read scan selector, so time-travel reads (by snapshot-id / tag / timestamp / version) were unreachable from C.

Brief change log

  • Add paimon_table_new_read_builder_with_options(table, options, options_len) taking a paimon_option array. The existing paimon_table_new_read_builder is kept and now delegates to it with an empty map (one shared implementation).
  • Resolve time-travel at builder construction: reject more than one time-travel selector up front; run the core's copy_with_time_travel; a selector that is set but does not resolve to a snapshot is an error — never a silent read-of-latest. Unsupported scan options (scan.watermark, incremental) surface as the core's typed error.
  • Pin both read-builder symbols with compile-time ABI signature guards.
  • Binding-only: no changes to the core crate.

Tests

  • cargo test -p paimon-c — empty options build like the plain builder, a non-selector option builds, >1 selector is rejected, an unsupported scan option is rejected, a malformed selector value fails closed (asserting the unified "did not resolve" error), and a null-pointer-with-length guard. Error-path tests assert the error identity, not just the shape.

API and Format

  • Adds one new C API symbol; no change to existing symbols or to any storage format.

Documentation

  • Doc comments on the new function.

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.

1 participant