liukun4515 commented on code in PR #1855:
URL: https://github.com/apache/arrow-rs/pull/1855#discussion_r934104663
##########
arrow/src/ipc/writer.rs:
##########
@@ -55,9 +61,50 @@ pub struct IpcWriteOptions {
/// version 2.0.0: V4, with legacy format enabled
/// version 4.0.0: V5
metadata_version: ipc::MetadataVersion,
+ batch_compression_type: CompressionCodecType,
}
impl IpcWriteOptions {
+ pub fn try_new_with_compression(
+ alignment: usize,
+ write_legacy_ipc_format: bool,
+ metadata_version: ipc::MetadataVersion,
+ batch_compression_type: CompressionCodecType,
+ ) -> Result<Self> {
+ if alignment == 0 || alignment % 8 != 0 {
+ return Err(ArrowError::InvalidArgumentError(
+ "Alignment should be greater than 0 and be a multiple of
8".to_string(),
+ ));
+ }
+ match batch_compression_type {
+ CompressionCodecType::NoCompression => {}
+ _ => {
+ if metadata_version != ipc::MetadataVersion::V5 {
+ return Err(ArrowError::InvalidArgumentError(
+ "Compress buffer just support from metadata
v5".to_string(),
Review Comment:
done
--
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]