[Prototype] feat: Concurrent identity columns - #3290
Draft
Rob2U wants to merge 5 commits into
Draft
Conversation
Rob2U
force-pushed
the
concurrent-identity-columns-prototype
branch
from
September 9, 2026 08:11
49d15a3 to
8d4b4d3
Compare
Signed-off-by: rob2u <weeke.robert@gmail.com>
…ager` Signed-off-by: rob2u <weeke.robert@gmail.com>
…nt ranges Signed-off-by: rob2u <weeke.robert@gmail.com>
Signed-off-by: rob2u <weeke.robert@gmail.com>
…yColumnManager` to `IdentityColumnWriter` Signed-off-by: rob2u <weeke.robert@gmail.com>
Rob2U
force-pushed
the
concurrent-identity-columns-prototype
branch
from
September 9, 2026 08:23
8d4b4d3 to
916d65b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are proposed in this pull request?
We would like to integrate the feature by allowing connectors to use the following two workflows:
Condensed from the runnable
examples/identity-column-demo.rs, which runs the whole flow against anInMemorySequenceClient(no external service).Create
Mint a
sequenceIdper identity column, stamp them into the schema, commitCREATE TABLE, and onlythen register the sequences with the service.
Write
Reload the snapshot (the CIC metadata is now on its schema), build one
IdentityColumnWriter,ensure_availablebefore filling, then write the filled batch as an ordinary append. Theengine-side batch has only the non-identity columns. The writer fills
idandrow_idandreturns every column in schema order, ready to write.
The resulting rows carry
id = [1, 2, 3]androw_id = [1000, 1010, 1020].Column metadata
A CIC column is marked by field metadata on an otherwise non-nullable
LONGfield. The keys (all under thedelta.identity.v2.prefix):delta.identity.v2.sequenceIddelta.identity.v2.startdelta.identity.v2.stepdelta.identity.v2.allowExplicitInsertThe presence of
sequenceIdis what identifies a column as CIC. When it is present,startandstepare also required (a missing one is an error). ThesequenceIdis a client-minted unique id of at most 64 characters.Structure of the changes
delta_kernel—identity_columns.rsIdentitySequenceState+ReservedRange,IdentityColumnInfo,detect_identity_columns,cic_column. No UC dependency.unity-catalog-delta-client-apiSequenceClienttrait, its models, andInMemorySequenceClient. No kernel dependency.delta-kernel-unity-catalogIdentityColumnWriter(write path) andregister_identity_sequences(CREATE-table).IdentitySequenceState
IdentitySequenceStateis the state that contains the core logic and state of a sequence. It holds one cursorper CIC column, a queue of
ReservedRanges plusavailable/inflight/claimedcounters, and knows nothing about any catalog.It has the following methods:
begin_reservesays what to reserve (aSequenceReservationRequestper column). The caller runsits RPC and
complete_reservefeeds the ranges backor
fail_reserverolls the in-flight count back.try_claimclaimscountfor one caller so concurrent callers get disjoint ranges. It only reportsthat a wait is needed (
ClaimOutcome::Wait), the actual waiting is the caller's job.ReservedRange { range_start, range_end, step }is the primitive providing the guarded enumeration logic.It is both used by the state and FFI.
IdentityColumnWriter
IdentityColumnWriter<C: SequenceClient>is the object a connector talks to while writing. It isan async wrapper over
IdentitySequenceState(stored in a mutex) and theSequenceClient. The writer supports threeoperations:
reserve(count)(async) — runsbegin_reserveunder the lock, issues oneReserveIdentityRangesRPC covering all columns, then feeds the result back via
complete_reserve/fail_reserveandsignals the
Notify. It returns a'staticfuture, so the engine cantokio::spawnit to prefetchthe next chunk or
awaitit inline.ensure_available(count)(async) — the pre-fill failsafe. Loops ontry_claim:Claimed->done.
Reserve(deficit)->await reserve(deficit).Wait->awaittheNotify, then re-check.fill_engine_batch(...)(sync) - delegates straight to the kernel, which fillsinput.len()values per identity column and returns every column in
target_schemaorder. Fails if a columnis short (i.e.
ensure_availablewas skipped).The division is as follows: The actual logic (the queue, counters, claim decision, step validation, and
value fill) are located in the kernel, but its integration with a client is done here in the writer.
The clients
SequenceClientmirrors the UC Identity Sequence Service's three RPCs:create_identity_sequences— create, or idempotently get, sequences (CREATE-table time).reserve_identity_ranges— reserve ranges from one or more sequences; returnedIdentityIdRangesare positional within the batch.
drop_identity_sequences— idempotently drop sequences (DROP / REPLACE), reporting whether each existed.A REST/HTTP implementation lives in
unity-catalog-delta-rest-clientand anInMemorySequenceClientserves tests.At CREATE-table time the
register_identity_sequences(client, table_id, &[IdentityColumnInfo])helper issues one batched create for every column (called after the create
commit succeeds).
How was this tested?
All introduced components have accompanying unit tests. Integration tests live in
delta-kernel-unity-catalog/tests/identity_columns.rs