Skip to content

Add fixed and variable closedness range canonical extension types #11370

Description

@Hoeze

Is your feature request related to a problem or challenge?

Arrow has no canonical type for ranges, i.e. intervals with a lower and an
upper bound. apache/arrow#50027 proposes two canonical extension types for
them, and apache/arrow#50028 adds the spec text and the C++ and Python
implementations. The proposal is being discussed on the Arrow dev mailing
list, and a vote will follow.

Describe the solution you'd like

Support both types in arrow-schema, like the other canonical extension
types:

  • arrow.fixed_closedness_range: storage Struct<lower: T, upper: T>,
    metadata {"closed": "left" | "right" | "both" | "neither"}. All values
    share one closedness.
  • arrow.variable_closedness_range: storage
    Struct<lower: T, upper: T, lower_inc: Boolean not null, upper_inc: Boolean not null>,
    metadata {}. The inclusivity of each bound is stored per value.

This would also give the proposal its second implementation, which the
canonical extension type process asks for when a type has parameters.

Describe alternatives you've considered

Defining the types as user extension types outside arrow-rs. That works, but
other crates could not rely on a shared definition.

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions