Skip to content

[elixir] feat: Support full table descriptor options in create_table#647

Open
nicolazar wants to merge 1 commit into
apache:mainfrom
nicolazar:elixir-create-table-descriptor
Open

[elixir] feat: Support full table descriptor options in create_table#647
nicolazar wants to merge 1 commit into
apache:mainfrom
nicolazar:elixir-create-table-descriptor

Conversation

@nicolazar

Copy link
Copy Markdown
Contributor

Purpose

This PR brings the Elixir's create_table descriptor to full parity with the native builder by also supporting :bucket_keys, :partition_keys, :custom_properties & comment, in addition to bucket_count and properties. These options are already surfaced on the read side in #640.

Linked issue: close #642

Brief change log

  • Add the four new options to Fluss.TableDescriptor.new!/2.
  • Bundle the optional fields into a Fluss.TableDescriptor.Options struct, decoded across the NIF as a NifStruct (NifTableOptions) instead of a long positional NIF signature.
  • Build the core descriptor with unconditional .properties/.custom_properties/.partitioned_by/.distributed_by calls
  • Change :properties from a list of {k, v} tuples to a map, matching :custom_properties and the map already returned by get_table_info.

Tests

New unit tests for the all-options constructions and integration tests which round-trips comment, custom_properties, explicit bucket_keys, and partition_keys via get_table_info.

API and Format

Elixir-only API change. :properties changes from a keyword/tuple list to a map for parity with the read side; no existing caller passed :properties.

Documentation

This commit brings the Elixir's create_table descriptor to full parity
with the native builder by also supporting :bucket_keys,
:partition_keys, :custom_properties & comment.

The optional fields are bundled into a Fluss.TableDescriptor.Options struct
decoded across the NIF boundary as a NifStruct (NifTableOptions), rather than
growing table_descriptor_new to seven positional arguments. This mirrors the
existing NifDatabaseDescriptor pattern and the Python binding, which builds the
core descriptor with unconditional .properties / .custom_properties /
.partitioned_by / .distributed_by calls.

:properties is now a map (was a list of {k, v} tuples), fixing a write/read
asymmetry — get_table_info already reports properties as a map — and matching
:custom_properties.
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.

[elixir] Add support for complex types - array, map & row

1 participant