apache / apache/arrow-rs

Implement TryFrom<primitive> for Arrow Flight protobuf Enums

Open
#4,022 1 comment 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.**
I am trying to implement a flight server.
As such, for example in the ``get_flight_info_sql_info`` method, we get a ``CommandGetSqlInfo`` result.
It's `.info` field is of type `Vec`. I would like to get the original Semantic (enum) back, so a `Vec`

**Describe the solution you'd like**
Implement TryFrom or something similar to get the enum back from the primitive.
Prost might even be able to generate this by adding `#[derive(::prost::Enumeration)]`:
https://docs.rs/prost/0.11.8/prost/index.html

**Describe alternatives you've considered**
Match all cases manually.

Contributor guide

Open the contributing guide

Research direction

Start at the Arrow Flight server path containing get_flight_info_sql_info and inspect CommandGetSqlInfo.info, which currently exposes primitive values. Read the generated protobuf enum definitions and Prost's Enumeration support, then identify the existing enum conversion tests or add focused coverage; done means valid values can be converted to SqlInfo and invalid values are handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.