Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataFusion TableProvider for memory arrays #384

Merged
merged 24 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 12 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
749 changes: 266 additions & 483 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"pyvortex",
"vortex-array",
"vortex-buffer",
"vortex-datafusion",
"vortex-dtype",
"vortex-error",
"vortex-expr",
Expand Down Expand Up @@ -41,15 +42,20 @@ arrow-data = "51.0.0"
arrow-ipc = "51.0.0"
arrow-schema = "51.0.0"
arrow-select = "51.0.0"
async-trait = "0.1"
bindgen = "0.69.4"
bytes = "1.6.0"
bzip2 = "0.4.4"
cargo_metadata = "0.18.1"
criterion = { version = "0.5.1", features = ["html_reports"] }
croaring = "1.0.1"
csv = "1.3.0"
datafusion-common = "39.0.0"
datafusion-expr = "39.0.0"
datafusion = "37.1.0"
datafusion-common = "37.1.0"
datafusion-execution = "37.1.0"
datafusion-expr = "37.1.0"
datafusion-physical-expr = "37.1.0"
datafusion-physical-plan = "37.1.0"
a10y marked this conversation as resolved.
Show resolved Hide resolved
gatesn marked this conversation as resolved.
Show resolved Hide resolved
derive_builder = "0.20.0"
divan = "0.1.14"
duckdb = { version = "0.10.1", features = ["bundled"] }
Expand Down
11 changes: 4 additions & 7 deletions vortex-array/src/array/primitive/compute/filter_indices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ fn apply_predicate<T: NativePType, F: Fn(&T, &T) -> bool>(

#[cfg(test)]
mod test {
use itertools::Itertools;
use vortex_dtype::field::FieldPath;
use vortex_expr::{lit, Conjunction, FieldPathOperations};

Expand All @@ -80,13 +79,11 @@ mod test {
}

fn to_int_indices(filtered_primitive: BoolArray) -> Vec<u64> {
let filtered = filtered_primitive
filtered_primitive
.boolean_buffer()
.iter()
.enumerate()
.flat_map(|(idx, v)| if v { Some(idx as u64) } else { None })
.collect_vec();
filtered
.set_indices()
.map(|i| i as u64)
.collect()
}

#[test]
Expand Down
1 change: 0 additions & 1 deletion vortex-array/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ impl Debug for ArrayView {
f.debug_struct("ArrayView")
.field("encoding", &self.encoding)
.field("dtype", &self.dtype)
// .field("array", &self.array)
.field("buffers", &self.buffers)
.field("ctx", &self.ctx)
.finish()
Expand Down
4 changes: 2 additions & 2 deletions vortex-buffer/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ use std::str::Utf8Error;

use crate::Buffer;

/// A wrapper around a `Buffer` that guarantees that the buffer contains valid UTF-8.
/// A wrapper around a [`Buffer`] that guarantees that the buffer contains valid UTF-8.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd)]
pub struct BufferString(Buffer);

impl BufferString {
/// Creates a new `BufferString` from a `Buffer`.
/// Creates a new `BufferString` from a [`Buffer`].
///
/// # Safety
/// Assumes that the buffer contains valid UTF-8.
Expand Down
35 changes: 35 additions & 0 deletions vortex-datafusion/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "vortex-datafusion"
version.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true
license.workspace = true
keywords.workspace = true
include.workspace = true
edition.workspace = true
rust-version.workspace = true

[dependencies]
vortex-array = { path = "../vortex-array" }
vortex-dtype = { path = "../vortex-dtype", features = ["arrow"] }
vortex-error = { path = "../vortex-error" }

arrow-array = { workspace = true }
arrow-schema = { workspace = true }
async-trait = { workspace = true }

datafusion = { workspace = true }
datafusion-common = { workspace = true }
datafusion-expr = { workspace = true }
datafusion-execution = { workspace = true }
datafusion-physical-expr = { workspace = true }
datafusion-physical-plan = { workspace = true }
futures = { workspace = true }
pin-project = { workspace = true }

[dev-dependencies]
tokio = { workspace = true, features = ["test-util"] }

[lints]
workspace = true
Loading
Loading