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
Improve ability of FlightDataEncoder to respect max_flight_data_size for certain data types (strings, dictionaries, etc) #3478
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Some implementations of gRPC, such as golang have a default max message size that is "relatively small" (4MB) and the clients will generate errors if they receive larger messages.
The FlightDataEncoder has a mechanism (link) to try and avoid this problem by heuristically slicing RecordBatchs into smaller parts to limit their size. This works well for primitive arrays but does not work well for other cases as we have found upstream in IOx:
DataType::Utf8 (only the offsets are sliced, the underlying string data is not sliced)
Lists, structs, and other nested types probably suffer from similar issues with maximum message sizes.
Of course, the smallest message possible is a single row, which can always be be significantly larger than whatever the max_flight_data_size limit is for variable length columns (e.g. several large string columns)
Describe the solution you'd like
I would like to improve the situation and handle nested types and more effectively reduce the FlightDataSize
Describe alternatives you've considered
One approach would be to copy the data into a new record batch, "packing" it into a brand new memory space (this is the approach I plan as a workaround in IOx) - this would result in the minimum sized flight data batches
Another way might be to implement a slice / take that resulted in smaller data sizes (e.g. rewrite data offsets for strings)
Activity
alamb commentedon Jan 6, 2023
In reviewing the arrow IPC writer code, it does appear to be clever about using offsets when actually writing (thanks @viirya in #2040 ❤️ )
arrow-rs/arrow-ipc/src/writer.rs
Lines 1094 to 1260 in acefeef
However, I am not sure exactly how this will translate to flight data size -- I am writing some more tests now
alamb commentedon Jan 6, 2023
PR with tests showing how far from optimal the current splitting logic is: #3481
itsjunetime commentedon Nov 4, 2024
take
fix: adaptively re-split oversized FlightData based on actual encoded…
fix: adaptively re-split oversized FlightData based on actual encoded…
fix: adaptively re-split oversized FlightData based on actual encoded…
fix: adaptively re-split oversized FlightData based on actual encoded…