Repository navigation
Conversation
Add the arrow.fixed_closedness_range canonical extension type: a bounded
interval over an orderable type T with a single type-level closedness
("left", "right", "both" or "neither") shared by all values, stored as a
two-field lower/upper struct where a null bound means an unbounded side.
… type Add the arrow.variable_closedness_range canonical extension type, the companion of arrow.fixed_closedness_range for ranges that cannot be canonicalized to a single closedness: each value carries its own lower_inc/upper_inc inclusivity flags alongside the lower/upper bounds, mirroring PostgreSQL's internal range representation.
Hoeze
force-pushed
the
feat/arrow-range-extension
branch
from
October 4, 2026 12:52
27a52a5 to
5b17b76
Compare
This branch has not been deployed
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.
Which issue does this PR close?
Rationale for this change
apache/arrow#50028 proposes two canonical extension types for ranges, i.e.
intervals with a lower and an upper bound over an orderable type T. This PR
adds them to
arrow-schemaas an independent Rust implementation. The typesonly become canonical after the vote on the Arrow dev mailing list, so this PR
should not be merged before the vote passes.
What changes are included in this PR?
FixedClosednessRange(arrow.fixed_closedness_range): storageStruct<lower: T, upper: T>, metadata{"closed": "left" | "right" | "both" | "neither"}.VariableClosednessRange(arrow.variable_closedness_range): storageStruct<lower: T, upper: T, lower_inc: Boolean, upper_inc: Boolean>,metadata
{}.CanonicalExtensionType.Metadata handling and storage validation follow the C++ implementation:
unknown metadata keys are ignored, and each bound may be nullable or not.
Are these changes tested?
Yes, with unit tests for both types: metadata round trips, and rejection of
invalid metadata and storage types.
Note that I made heavy use of AI to create this PR and copied many structures
from the existing
Opaqueand tensor extension types. I reviewed each changeand hope the changes I made are meaningful.
Are there any user-facing changes?
Yes, but only additions behind the
canonical_extension_typesfeature.CanonicalExtensionTypeis#[non_exhaustive], so the new variants are notbreaking.