Skip to content

Commit 398a43f

Browse files
committed
cleanup
1 parent 01b2fc5 commit 398a43f

File tree

5 files changed

+56
-64
lines changed

5 files changed

+56
-64
lines changed

Cargo.lock

+47-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

duckdb-vortex-rs/Cargo.toml

+3-5
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@ crate-type = ["staticlib"]
2222
[dependencies]
2323
duckdb = { version = "1.2.0", features = ["vtab-loadable"] }
2424
duckdb-loadable-macros = "0.1.4"
25+
futures = { workspace = true, features = ["alloc"] }
2526
libduckdb-sys = { version = "1.2.0", features = ["loadable-extension"] }
27+
tokio = { workspace = true, features = ["fs", "rt-multi-thread"] }
2628
vortex-array = { workspace = true }
27-
vortex-buffer = { workspace = true }
2829
vortex-duckdb = { workspace = true }
29-
vortex-dtype = { workspace = true }
30-
vortex-layout = { workspace = true, features = ["tokio"] }
3130
vortex-error = { workspace = true }
32-
futures = { workspace = true, features = ["alloc"] }
3331
vortex-file = { workspace = true, features = ["tokio"] }
3432
vortex-io = { workspace = true, features = ["tokio"] }
35-
tokio = { workspace = true, features = ["fs", "rt-multi-thread"] }
33+
vortex-layout = { workspace = true, features = ["tokio"] }

duckdb-vortex-rs/src/lib.rs

-22
Original file line numberDiff line numberDiff line change
@@ -89,35 +89,13 @@ impl VTab for HelloVTab {
8989
let arr = rt.block_on(async {
9090
let mut stream = bind_data.stream.lock().await;
9191
stream.next().await
92-
93-
// let pos = init_data.position.load(Ordering::SeqCst);
94-
// let next_pos = min(pos + 2048, arr.len());
95-
// let arr = slice(arr, pos, next_pos).unwrap();
96-
// init_data.position.store(next_pos, Ordering::SeqCst);
9792
});
9893

9994
let Some(arr) = arr else {
10095
output.set_len(0);
10196
return Ok(());
10297
};
10398

104-
// Ok(vxf
105-
// .scan()
106-
// .with_projection(projection)
107-
// .with_some_filter(filter)
108-
// .with_prefetch_conjuncts(true)
109-
// .with_canonicalize(true)
110-
// // DataFusion likes ~8k row batches. Ideally we would respect the config,
111-
// // but at the moment our scanner has too much overhead to process small
112-
// // batches efficiently.
113-
// .with_split_by(SplitBy::RowCount(8 * batch_size))
114-
// .with_task_executor(executor)
115-
// .into_array_stream()?
116-
// .map(move |array| {
117-
// let st = array?.to_struct()?;
118-
// Ok(st.into_record_batch_with_schema(projected_arrow_schema.as_ref())?)
119-
// })
120-
// .boxed())
12199
let arr = arr.unwrap();
122100
let struct_a = arr.to_struct().unwrap();
123101
let _null = to_duckdb_chunk(&struct_a, output).unwrap();

duckdb-vortex-rs/src/wasm_lib.rs

-14
This file was deleted.

vortex-duckdb/src/convert/array/mod.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ pub trait ToDuckDB {
2121
pub fn to_duckdb_chunk(
2222
struct_array: &StructArray,
2323
chunk: &mut DataChunkHandle,
24-
) -> VortexResult<Vec<bool>> {
25-
let mut nullable = vec![false; struct_array.len()];
24+
) -> VortexResult<()> {
2625
for (idx, field) in struct_array.fields().iter().enumerate() {
2726
field.to_duckdb(&mut DataChunkHandleSlice::new(chunk, idx))?;
28-
nullable[idx] = field.dtype().is_nullable();
2927
}
3028
chunk.set_len(struct_array.len());
31-
Ok(nullable)
29+
Ok(())
3230
}
3331

3432
impl ToDuckDB for ArrayRef {
@@ -90,7 +88,6 @@ impl FromDuckDB<SizedFlatVector> for ArrayRef {
9088
#[cfg(test)]
9189
mod tests {
9290
use duckdb::core::DataChunkHandle;
93-
use itertools::Itertools;
9491
use vortex_array::arrays::{BoolArray, PrimitiveArray, StructArray, VarBinArray};
9592
use vortex_array::validity::Validity;
9693
use vortex_array::variants::StructArrayTrait;
@@ -122,16 +119,16 @@ mod tests {
122119
#[test]
123120
fn test_vortex_to_duckdb() {
124121
let arr = data();
125-
let ddb_type = arr
122+
let (nullable, ddb_type): (Vec<_>, Vec<_>) = arr
126123
.dtype()
127124
.as_struct()
128125
.unwrap()
129126
.fields()
130-
.map(|f| f.to_duckdb_type().unwrap())
131-
.collect_vec();
127+
.map(|f| (f.is_nullable(), f.to_duckdb_type().unwrap()))
128+
.unzip();
132129
let struct_arr = arr.to_struct().unwrap();
133130
let mut output_chunk = DataChunkHandle::new(ddb_type.as_slice());
134-
let nullable = to_duckdb_chunk(&struct_arr, &mut output_chunk).unwrap();
131+
to_duckdb_chunk(&struct_arr, &mut output_chunk).unwrap();
135132

136133
let vx_arr = ArrayRef::from_duckdb(&NamedDataChunk::new(
137134
&output_chunk,

0 commit comments

Comments
 (0)