-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ergonomic field and schema creation with Metadata #1091
Comments
In arrow2 we noticed the same problem. The solution we took was to make all members of Schema public - there is no invariant betweem them, so there is nothing that users can break by accessing individual members. |
@jorgecarleitao I looked at the https://github.com/jorgecarleitao/arrow2/blob/main/src/datatypes/schema.rs#L30 |
Oh, sorry, I skipped the 3rd item by mistake. I do not remember the reason. Had a quick look at the spec:
I suspect that in both cases they are meant to represent unique keys without a specific order, but it is not clear to me atm. imo it is very much worth investigating if we can get away with a common representation under the integration tests - as you wrote, much easier to reason about. |
I played with this idea and I think that for us the main difference between them is whether Because some variants of The |
In I wonder if we implemented something similar to https://docs.rs/tonic/0.6.2/tonic/metadata/struct.MetadataMap.html struct MetadataMap {
...
} Which implements whatever semantics we needed |
Looks like there is a related PR in arrow2: jorgecarleitao/arrow2#715 |
I was waiting for another (soon to be PR) before reporting here, but basically it is possible to remove There is a larger change going on there, jorgecarleitao/arrow2#717, that removes |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
There are a few issues that make it annoying to work with Schema and Field metadata:
mut Field
has to be creatednew_with_schema
)&HashMap
and Field provides aOption<&BtreeMap>
Describe the solution you'd like
My proposal will be two parts:
with_metatada()
)Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: