You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "zeroshade (via GitHub)" <gi...@apache.org> on 2023/10/04 17:49:20 UTC
Re: [I] [Go][Parquet] Writing a Parquet file from a slice of structs [arrow]
zeroshade commented on issue #37807:
URL: https://github.com/apache/arrow/issues/37807#issuecomment-1747372228
So, first and foremost: You're completely right, there isn't currently a good / efficient way to convert a slice of structs to an arrow record / struct array. My initial reaction would be to suggest converting the structs to JSON and then using `RecordFromJSON`, but you'd still have to create the reflection to actually generate the Arrow Schema (since all of the `FromJSON` methods require providing an existing arrow schema rather than having implemented the reflection to generate one myself). But you're write that this would be even less efficient.
The most "ergonomic" way to do this would likely to bypass the conversion to arrow in the first place and just use the column chunk writers directly from the `file` package.
That all said, it would probably be pretty useful if we did implement a full reflection based way of converting a struct to an arrow schema (like already exists for converting a struct to a parquet schema) or instantiate a `RecordBuilder` or `StructBuilder` from a struct and then allow appending a slice of that struct to the builder.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org