itsjunetime commented on code in PR #6690:
URL: https://github.com/apache/arrow-rs/pull/6690#discussion_r1842622244
##########
arrow-ipc/src/writer.rs:
##########
@@ -448,15 +454,45 @@ impl IpcDataGenerator {
Ok(())
}
+ /// Calls [`Self::encoded_batch_with_size`] with no limit, returning the
first (and only)
+ /// [`EncodedData`] that is produced. This method should be used over
+ /// [`Self::encoded_batch_with_size`] if the consumer has no concerns
about encoded message
+ /// size limits
+ pub fn encoded_batch(
+ &self,
+ batch: &RecordBatch,
+ dictionary_tracker: &mut DictionaryTracker,
+ write_options: &IpcWriteOptions,
+ ) -> Result<(Vec<EncodedData>, EncodedData), ArrowError> {
+ let (encoded_dictionaries, mut encoded_messages) =
+ self.encoded_batch_with_size(batch, dictionary_tracker,
write_options, usize::MAX)?;
+
+ assert_eq!(
+ encoded_messages.len(),
+ 1,
+ "encoded_batch with max size of usize::MAX should not be able to
return more or less than 1 batch"
+ );
+
+ Ok((encoded_dictionaries, encoded_messages.pop().unwrap()))
+ }
+
/// Encodes a batch to a number of [EncodedData] items (dictionary batches
+ the record batch).
/// The [DictionaryTracker] keeps track of dictionaries with new
`dict_id`s (so they are only sent once)
/// Make sure the [DictionaryTracker] is initialized at the start of the
stream.
- pub fn encoded_batch(
+ /// The `max_flight_data_size` is used to control how much space each
encoded [`RecordBatch`] is
Review Comment:
Done in 652aa2753204a7b25ffcdd324449791679edf0ad
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]