Skip to content

Commit 157ee48

Browse files
committed
ok nvm then
Signed-off-by: Andrew Duffy <[email protected]>
1 parent d4acdd1 commit 157ee48

File tree

4 files changed

+18
-31
lines changed

4 files changed

+18
-31
lines changed

vortex-duckdb/src/copy.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,7 @@ impl CopyFunction for VortexCopyFunction {
128128
let handle = SESSION.handle();
129129
let write_task = handle.spawn(async move {
130130
let mut file = async_fs::File::create(file_path).await?;
131-
SESSION
132-
.write_options()
133-
.write(&mut file, array_stream)
134-
.await
135-
.map(|(summary, _)| summary)
131+
SESSION.write_options().write(&mut file, array_stream).await
136132
});
137133

138134
let worker_pool = RUNTIME.new_pool();

vortex-file/src/writer.rs

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl VortexWriteOptions {
128128
self,
129129
write: W,
130130
stream: S,
131-
) -> VortexResult<(WriteSummary, W)> {
131+
) -> VortexResult<WriteSummary> {
132132
self.write_internal(write, ArrayStreamExt::boxed(stream))
133133
.await
134134
}
@@ -137,7 +137,7 @@ impl VortexWriteOptions {
137137
self,
138138
mut write: W,
139139
stream: SendableArrayStream,
140-
) -> VortexResult<(WriteSummary, W)> {
140+
) -> VortexResult<WriteSummary> {
141141
// Set up a Context to capture the encodings used in the file.
142142
let ctx = ArrayContext::empty();
143143
let dtype = stream.dtype().clone();
@@ -216,13 +216,10 @@ impl VortexWriteOptions {
216216

217217
write.flush().await?;
218218

219-
Ok((
220-
WriteSummary {
221-
footer,
222-
size: position,
223-
},
224-
write,
225-
))
219+
Ok(WriteSummary {
220+
footer,
221+
size: position,
222+
})
226223
}
227224

228225
/// Create a push-based [`Writer`] that can be used to incrementally write arrays to the file.
@@ -236,11 +233,7 @@ impl VortexWriteOptions {
236233
let write = CountingVortexWrite::new(write);
237234
let bytes_written = write.counter();
238235
let strategy = self.strategy.clone();
239-
let future = self
240-
.write(write, arrays)
241-
.map(move |result| result.map(|(summary, _writer)| summary))
242-
.boxed_local()
243-
.fuse();
236+
let future = self.write(write, arrays).boxed_local().fuse();
244237

245238
Writer {
246239
arrays: Some(arrays_send),
@@ -377,13 +370,11 @@ impl<'rt, B: BlockingRuntime> BlockingWrite<'rt, B> {
377370
write: W,
378371
iter: impl ArrayIterator + Send + 'static,
379372
) -> VortexResult<WriteSummary> {
380-
self.runtime
381-
.block_on(async move {
382-
self.options
383-
.write(BlockingWriteAdapter(write), iter.into_array_stream())
384-
.await
385-
})
386-
.map(|(summary, _)| summary)
373+
self.runtime.block_on(async move {
374+
self.options
375+
.write(BlockingWriteAdapter(write), iter.into_array_stream())
376+
.await
377+
})
387378
}
388379

389380
pub fn writer<'w, W: Write + Unpin + 'w>(

vortex-file/tests/test_write_table.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ async fn test_file_roundtrip() {
7777
.set_field_writer(field_path!(a.raw), Arc::new(FlatLayoutStrategy::default())),
7878
);
7979

80-
let bytes = Vec::new();
81-
let (_, bytes) = SESSION
80+
let mut bytes = Vec::new();
81+
SESSION
8282
.write_options()
8383
.with_strategy(writer)
84-
.write(bytes, data.to_array_stream())
84+
.write(&mut bytes, data.to_array_stream())
8585
.await
8686
.expect("write");
8787

vortex-jni/src/writer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ pub extern "system" fn Java_dev_vortex_jni_NativeWriterMethods_create(
176176

177177
let (store, _scheme) = make_object_store(&url, &properties)?;
178178
let write_handle = SESSION.handle().spawn(async move {
179-
let write = ObjectStoreWriter::new(store, &path).await?;
180-
let (summary, mut write) = SESSION.write_options().write(write, w).await?;
179+
let mut write = ObjectStoreWriter::new(store, &path).await?;
180+
let summary = SESSION.write_options().write(&mut write, w).await?;
181181
write.shutdown().await?;
182182
Ok(summary)
183183
});

0 commit comments

Comments
 (0)