jorgecarleitao / arrow2

Transmute-free Rust library to work with the Arrow format
Apache License 2.0
1.06k stars 222 forks source link

Redundant work when using both `io::write::FileWriter` and `io::flight::serialize_*` methods. #1309

Open GPSnoopy opened 1 year ago

GPSnoopy commented 1 year ago

With my limited understanding (correct me if I'm wrong), apart from their different headers, I'd say that both the Feather file format and the Flight FlightData messages are identical.

In my application, I'm creating a Feather file and the corresponding FlightData messages, both using IPC Zstd compression.

If it is true that the data content is identical, it seems rather wasteful to compress twice the same data. Is there a way to write a Feather chunk from the already-compressed corresponding FlightData messages? If not, could we introduce such an API?

jorgecarleitao commented 1 year ago

Hey @GPSnoopy ! Yes, it is not possible. Yes it should be possible. :)

I think we would need something like: