Skip to content
Merged
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
2 changes: 2 additions & 0 deletions vortex-cxx/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use vortex::dtype::DType;
use vortex::dtype::arrow::FromArrowType;
use vortex::error::{VortexError, VortexExpect};
use vortex::file::VortexWriteOptions as WriteOptions;
use vortex::io::VortexWrite;
use vortex::io::runtime::tokio::TokioRuntime;
use vortex::iter::{ArrayIteratorAdapter, ArrayIteratorExt};
use vortex::stream::ArrayStream;
Expand Down Expand Up @@ -67,6 +68,7 @@ pub(crate) unsafe fn write_array_stream(
RUNTIME.block_on(async {
let mut file = tokio::fs::File::create(path).await?;
options.inner.write(&mut file, vortex_stream).await?;
file.shutdown().await?;
Ok(())
})
}
8 changes: 4 additions & 4 deletions vortex-tui/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use futures::StreamExt;
use indicatif::ProgressBar;
use parquet::arrow::ParquetRecordBatchStreamBuilder;
use tokio::fs::File;
use tokio::io::AsyncWriteExt;
use vortex::ArrayRef;
use vortex::arrow::FromArrowArray;
use vortex::compressor::CompactCompressor;
Expand Down Expand Up @@ -80,13 +81,12 @@ pub async fn exec_convert(flags: Flags) -> anyhow::Result<()> {
Strategy::Compact => strategy.with_compressor(CompactCompressor::default()),
};

let mut file = File::create(output_path).await?;
VortexWriteOptions::default()
.with_strategy(strategy.build())
.write(
&mut File::create(output_path).await?,
ArrayStreamAdapter::new(dtype, vortex_stream),
)
.write(&mut file, ArrayStreamAdapter::new(dtype, vortex_stream))
.await?;
file.shutdown().await?;

Ok(())
}
Loading