Skip to content

Commit

Permalink
Increase default IPC alignment to 64 (#2883) (#2884)
Browse files Browse the repository at this point in the history
* Increase default IPC alignment to 64 (#2883)

* Update test
  • Loading branch information
tustvold authored Oct 16, 2022
1 parent ede36d7 commit a3effc1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arrow/src/ipc/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use ipc::CONTINUATION_MARKER;
#[derive(Debug, Clone)]
pub struct IpcWriteOptions {
/// Write padding after memory buffers to this multiple of bytes.
/// Generally 8 or 64, defaults to 8
/// Generally 8 or 64, defaults to 64
alignment: usize,
/// The legacy format is for releases before 0.15.0, and uses metadata V4
write_legacy_ipc_format: bool,
Expand Down Expand Up @@ -132,7 +132,7 @@ impl IpcWriteOptions {
impl Default for IpcWriteOptions {
fn default() -> Self {
Self {
alignment: 8,
alignment: 64,
write_legacy_ipc_format: false,
metadata_version: ipc::MetadataVersion::V5,
batch_compression_type: None,
Expand Down Expand Up @@ -788,7 +788,8 @@ impl<W: Write> StreamWriter<W> {
///
/// ```
/// # use arrow::datatypes::Schema;
/// # use arrow::ipc::writer::StreamWriter;
/// # use arrow::ipc::writer::{StreamWriter, IpcWriteOptions};
/// # use arrow::ipc::MetadataVersion;
/// # use arrow::error::ArrowError;
/// # fn main() -> Result<(), ArrowError> {
/// // The result we expect from an empty schema
Expand All @@ -807,7 +808,8 @@ impl<W: Write> StreamWriter<W> {
///
/// let schema = Schema::new(vec![]);
/// let buffer: Vec<u8> = Vec::new();
/// let stream_writer = StreamWriter::try_new(buffer, &schema)?;
/// let options = IpcWriteOptions::try_new(8, false, MetadataVersion::V5)?;
/// let stream_writer = StreamWriter::try_new_with_options(buffer, &schema, options)?;
///
/// assert_eq!(stream_writer.into_inner()?, expected);
/// # Ok(())
Expand Down

0 comments on commit a3effc1

Please sign in to comment.