Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions crates/paimon/src/io/file_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,18 @@ impl OutputFile {

/// Get an async streaming writer for format-level writes (e.g. parquet).
pub(crate) async fn async_writer(&self) -> crate::Result<Box<dyn AsyncFileWrite>> {
self.async_writer_with_concurrency(1).await
}

pub(crate) async fn async_writer_with_concurrency(
&self,
concurrency: usize,
) -> crate::Result<Box<dyn AsyncFileWrite>> {
let (op, relative_path, cache_path) = self.resolve().await?;
let writer: Box<dyn AsyncFileWrite> = Box::new(
op.writer_with(&relative_path)
.chunk(8 * 1024 * 1024)
.concurrent(1)
.concurrent(concurrency)
.await?
.into_futures_async_write()
.compat_write(),
Expand All @@ -860,6 +867,9 @@ impl OutputFile {
}
}

#[cfg(test)]
pub(crate) mod multipart_test;

#[cfg(test)]
mod file_action_test {
use std::collections::BTreeSet;
Expand Down Expand Up @@ -1937,7 +1947,7 @@ mod input_output_test {
let mut writer = file_io
.new_output(&location)
.unwrap()
.async_writer()
.async_writer_with_concurrency(8)
.await
.unwrap();
writer.write_all(b"new metadata").await.unwrap();
Expand Down
Loading
Loading