Skip to content

table: add shared write options and create-table options - #145

Closed
Xuanwo wants to merge 2 commits into
mainfrom
xuanwo/create-table-write-options
Closed

Xuanwo wants to merge 2 commits into
mainfrom
xuanwo/create-table-write-options

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Superseded by #151, which retains the reviewed create and write options, fixes the Clippy diagnostic and corrects commit authorship. Investigation of the namespace create Valgrind finding continues there.

Adds the shared C representation of the SDK write options and a create-table entry that applies the SDK create builder options. Refs #125.

What changed

  • LanceDBWriteOptions with a set_fields bitmask for max rows per file, max rows per group, max bytes per file, data storage version and stable row IDs. Omitted fields keep SDK defaults, while explicit zero/false stay distinguishable. A NULL pointer or zero mask leaves WriteOptions.lance_write_params unset, so default remote create still works.
  • LanceDBCreateTableOptions and lancedb_table_create_with_options with Create/Overwrite/ExistOk, namespace path, location, per-table storage options, external-blob option and optional write options. Write options are applied before the per-table storage and external-blob setters.
  • ExistOk uses the SDK callback and restores the create location and per-table storage options to the callback's open request. A custom-location table is reopened instead of a same-name default-root table.
  • The new entry consumes a non-NULL reader exactly once, including argument, option, schema and SDK errors. It clears a non-NULL table_out on entry and writes it only on success. The legacy lancedb_table_create behavior is unchanged and its header ownership description is corrected.
  • Uses the shared namespace_path_from_c parser from connection: add multi-level namespace paths #137.

Tests

  • C++ coverage for ExistOk vs Overwrite, explicit write options, custom location, per-table storage options, nested namespace create/listing with limit and start_after, and new-vs-legacy table_out failure behavior.
  • Rust unit coverage for write-option conversion, ExistOk callback location/storage propagation, and exactly-once reader release.

Verification

  • cargo test --lib --locked: 12/12 passed on the unchanged tree.
  • cargo check --all-targets --locked: passed.
  • C ABI host LP64 and MSVC LLP64: 165 functions, 30 structs, 8 enums.
  • Strict C17 header, C++ test syntax, cargo fmt --check and git diff --check: passed.
  • Real consumer runtime and Clippy are left to CI; no heavy local build was repeated.

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