This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
104ecd6
commit 0d83e51
Showing
11 changed files
with
100 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use crate::array::ffi::ToFfi; | ||
|
||
use super::FixedSizeBinaryArray; | ||
|
||
unsafe impl ToFfi for FixedSizeBinaryArray { | ||
fn buffers(&self) -> Vec<Option<std::ptr::NonNull<u8>>> { | ||
let offset = self | ||
.validity | ||
.as_ref() | ||
.map(|x| x.offset()) | ||
.unwrap_or_default(); | ||
let offset = offset * self.size(); | ||
|
||
// note that this may point to _before_ the pointer. This is fine because the C data interface | ||
// requires users to only access past the offset | ||
let values = | ||
std::ptr::NonNull::new( | ||
unsafe { self.values.as_ptr().offset(-(offset as isize)) } as *mut u8 | ||
); | ||
|
||
vec![self.validity.as_ref().map(|x| x.as_ptr()), values] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use std::sync::Arc; | ||
|
||
use crate::array::ffi::ToFfi; | ||
use crate::array::Array; | ||
|
||
use super::FixedSizeListArray; | ||
|
||
unsafe impl ToFfi for FixedSizeListArray { | ||
fn buffers(&self) -> Vec<Option<std::ptr::NonNull<u8>>> { | ||
vec![self.validity.as_ref().map(|x| x.as_ptr())] | ||
} | ||
|
||
fn children(&self) -> Vec<Arc<dyn Array>> { | ||
vec![self.values().clone()] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters