-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FLUP: we should probably just turn this into an array and implement the array trait for it?
- Loading branch information
Showing
61 changed files
with
702 additions
and
544 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
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 |
---|---|---|
@@ -1,24 +1,19 @@ | ||
use std::sync::Arc; | ||
|
||
use arrow_array::{ArrayRef as ArrowArrayRef, BooleanArray as ArrowBoolArray}; | ||
use arrow_buffer::NullBuffer; | ||
|
||
use vortex_error::VortexResult; | ||
|
||
use crate::array::bool::BoolArray; | ||
use crate::arrow::wrappers::as_nulls; | ||
use crate::compute::as_arrow::AsArrowArray; | ||
use crate::compute::flatten::flatten_bool; | ||
use crate::validity::ArrayValidity; | ||
|
||
impl AsArrowArray for BoolArray { | ||
fn as_arrow(&self) -> VortexResult<ArrowArrayRef> { | ||
let validity = self | ||
.validity() | ||
.map(|a| flatten_bool(a.as_ref())) | ||
.transpose()? | ||
.map(|b| NullBuffer::new(b.buffer)); | ||
Ok(Arc::new(ArrowBoolArray::new( | ||
self.buffer().clone(), | ||
validity, | ||
as_nulls(self.validity())?, | ||
))) | ||
} | ||
} |
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
Oops, something went wrong.