diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 4a3c4e8f5..7b452c291 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -8,7 +8,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.18.0" +version = "0.18.1" homepage = "https://v6d.io" repository = "https://github.com/v6d-io/v6d.git" authors = ["Vineyard "] @@ -22,11 +22,11 @@ edition = "2021" readme = "README.md" [workspace.dependencies] -arrow-array = ">=40, <47" -arrow-buffer = ">=40, <47" -arrow-ipc = ">=40, <47" -arrow-schema = ">=40, <47" -arrow2 = { version = ">=0.17, <0.19", features = ["arrow"] } +arrow-array = ">=40, <45" +arrow-buffer = ">=40, <45" +arrow-ipc = ">=40, <45" +arrow-schema = ">=40, <45" +arrow2 = { version = ">=0.17, <0.18", features = ["arrow"] } ctor = "0.2" datafusion = ">= 28" downcast-rs = "1.2" @@ -41,6 +41,7 @@ memmap2 = "0.7" num-traits = ">= 0.2" num-derive = ">= 0.4" parking_lot = "0.12" +polars-arrow = ">=0.32, <34" polars-core = ">=0.32, <34" rand = "0.8" sendfd = "0.4" @@ -50,7 +51,7 @@ serde_json = "1.0" spectral = "0.6" static_str_ops = "0.1.2" -vineyard = { version = "0.18.0", path = "./vineyard" } -vineyard-datafusion = { version = "0.18.0", path = "./vineyard-datafusion" } -vineyard-polars = { version = "0.18.0", path = "./vineyard-polars" } -vineyard-integration-testing = { version = "0.18.0", path = "./vineyard-integration-testing" } +vineyard = { version = "0.18.1", path = "./vineyard" } +vineyard-datafusion = { version = "0.18.1", path = "./vineyard-datafusion" } +vineyard-polars = { version = "0.18.1", path = "./vineyard-polars" } +vineyard-integration-testing = { version = "0.18.1", path = "./vineyard-integration-testing" } diff --git a/rust/vineyard-polars/Cargo.toml b/rust/vineyard-polars/Cargo.toml index 313982ccf..3e813f53f 100644 --- a/rust/vineyard-polars/Cargo.toml +++ b/rust/vineyard-polars/Cargo.toml @@ -23,6 +23,7 @@ arrow-array = { workspace = true } arrow-schema = { workspace = true } arrow2 = { workspace = true } itertools = { workspace = true } +polars-arrow = { workspace = true } polars-core = { workspace = true } serde_json = { workspace = true } vineyard = { workspace = true } diff --git a/rust/vineyard/src/common/util/arrow.rs b/rust/vineyard/src/common/util/arrow.rs index af7ec953c..1d947b602 100644 --- a/rust/vineyard/src/common/util/arrow.rs +++ b/rust/vineyard/src/common/util/arrow.rs @@ -15,7 +15,7 @@ use std::ptr::NonNull; use std::sync::Arc; -use arrow_buffer::{alloc, Buffer}; +use arrow_buffer::{alloc, Buffer, MutableBuffer}; /// An `arrow::alloc::Allocation` implementation to prevent the pointer /// been freed by `arrow::Buffer`. @@ -46,13 +46,17 @@ pub fn arrow_buffer_mut(pointer: *mut u8, len: usize) -> Buffer { } pub fn arrow_buffer_with_offset_mut(pointer: *mut u8, offset: isize, len: usize) -> Buffer { - return unsafe { - Buffer::from_custom_allocation( - NonNull::new_unchecked(pointer.offset(offset) as *mut u8), - len, - MMAP_ALLOCATION.clone(), - ) - }; + if pointer.is_null() { + return MutableBuffer::new(0).into(); + } else { + return unsafe { + Buffer::from_custom_allocation( + NonNull::new_unchecked(pointer.offset(offset)), + len, + MMAP_ALLOCATION.clone(), + ) + }; + } } pub fn arrow_buffer_null() -> Buffer {