You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++] Add a struct_ overload taking a vector of (name, type) pairs #36867
@pitrou Hi,I have a question regarding this issue and I want to ask for your advice.
In this code, because field is a function with default parameters, one can pass not only name and type to this function, but also nullable and metadata struct_({field("a", int8()), field("b", utf8())});
but in the following form, I can use std::initializer_list<std::pair<std::string, std::shared_ptr>> as the input parameter, but in this way it's hard to add support for passing in nullable and metadata conveniently like the field function. std::tuple doesn't support default parameters too. struct_({{"a", int8()}, {"b", utf8()}});
I guess there is a better way to write this overload function or shall we just support (name, type) pairs for now?
Thanks for your time.
Activity
jsjtxietian commentedon Jul 25, 2023
I can take this issue if no one has started working on it yet.
pitrou commentedon Jul 25, 2023
@jsjtxietian Yes, you can submit a PR if you want.
jsjtxietian commentedon Jul 26, 2023
@pitrou Hi,I have a question regarding this issue and I want to ask for your advice.
In this code, because field is a function with default parameters, one can pass not only name and type to this function, but also nullable and metadata
struct_({field("a", int8()), field("b", utf8())});but in the following form, I can use std::initializer_list<std::pair<std::string, std::shared_ptr>> as the input parameter, but in this way it's hard to add support for passing in nullable and metadata conveniently like the field function. std::tuple doesn't support default parameters too.
struct_({{"a", int8()}, {"b", utf8()}});I guess there is a better way to write this overload function or shall we just support (name, type) pairs for now?
Thanks for your time.
pitrou commentedon Jul 26, 2023
hi @jsjtxietian
We can just support (name, type) pairs since that's the common case anyway.
GH-36867: [C++] Add a struct_ and schema overload taking a vector of …
apacheGH-36867: [C++] Add a struct_ and schema overload taking a vect…