apache / apache/arrow-rs

Remove `dict_id` from `arrow_schema::field::Field` and make dictionary IDs an internal implementation detail of flight encoding/decoding

Open
#5,981 14 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
3.6k
Forks
1.3k
Avg merge
2d 14h
Merged PRs (30d)
167

Description

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

Currently the `dict_id` field is only used for the purposes of arrow flight encoding/decoding so dictionaries can be mapped to there associated fields.

This is annoying and error-prone as the user is left the responsibility of assigning these dictionary IDs and ensuring that they are unique.

https://github.com/apache/arrow-rs/pull/5971 adds the option to auto-assign dictionary IDs during arrow flight encoding. This can be enabled by setting the `preserve_dict_id` option in `IpcWriteOptions` to `false` (current default is `true`

**Describe the solution you'd like**

This can be done in stages but ultimately would like to
1. Make `preserve_dict_id` default to `false`
2. Remove the `preserve_dict_id` option altogether
3. Remove the `dict_id` field from `arrow_schema::schema::Field` entirely as it no longer has any purpose

**Describe alternatives you've considered**

We can leave this is as a configurable option and either only do 1 above or we can leave auto-assigning of dictionary IDs as an opt-in feature

**Additional context**

Contributor guide

Open the contributing guide

Research direction

Start with PR #5971 and trace uses of `arrow_schema::schema::Field.dict_id` and `IpcWriteOptions::preserve_dict_id` in Flight encoding and decoding. Determine how dictionary IDs are assigned and mapped to fields before carrying out the staged API changes. Done means dictionary mapping still works while the option and field are no longer part of the public API.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.