apache / apache/arrow-rs

[Arrow] Integrate `ExtensionType::validate` within `ExtensionType::try_new`

Open
#9,708 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
3.6k
Forks
1.3k
Avg merge
2d 18h
Merged PRs (30d)
169

Description

**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**

In #9677 @scovich and @alamb proposed integrating the new `validate` API within `try_new`.

It will reduce code duplication, improve modularity and prevent the potential slowdown from using the default value.

**Describe the solution you'd like**

Move the `ExtensionType` validation logic from the `try_new` into `validate`. Use `validate` in `try_new`.

**Describe alternatives you've considered**

Not do anything since there aren't too many plain validation cases in the codebase yet.

**Additional context**

Contributor guide

Open the contributing guide

Research direction

Start by reading the ExtensionType::try_new and ExtensionType::validate entry points and compare their current validation responsibilities. Check existing ExtensionType validation cases and tests, then confirm that try_new uses validate without changing the resulting validation behavior or relying on a default value.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.