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

Binary Boolean VTable #1407

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 0 additions & 4 deletions bench-vortex/src/bin/notimplemented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ fn compute_funcs(encodings: &[ArrayData]) {
"search_sorted",
"slice",
"take",
"and",
gatesn marked this conversation as resolved.
Show resolved Hide resolved
"or",
]
.into_iter()
.map(Cell::new)
Expand All @@ -207,8 +205,6 @@ fn compute_funcs(encodings: &[ArrayData]) {
impls.push(bool_to_cell(arr.with_dyn(|a| a.search_sorted().is_some())));
impls.push(bool_to_cell(arr.encoding().slice_fn().is_some()));
impls.push(bool_to_cell(arr.encoding().take_fn().is_some()));
impls.push(bool_to_cell(arr.with_dyn(|a| a.and().is_some())));
impls.push(bool_to_cell(arr.with_dyn(|a| a.or().is_some())));
table.add_row(Row::new(impls));
}
table.printstd();
Expand Down
48 changes: 0 additions & 48 deletions vortex-array/src/array/bool/compute/boolean.rs

This file was deleted.

24 changes: 13 additions & 11 deletions vortex-array/src/array/bool/compute/mod.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
use crate::array::{BoolArray, BoolEncoding};
use crate::compute::unary::{FillForwardFn, ScalarAtFn};
use crate::compute::{AndFn, ArrayCompute, ComputeVTable, FilterFn, OrFn, SliceFn, TakeFn};
use crate::compute::{ArrayCompute, BinaryBooleanFn, ComputeVTable, FilterFn, SliceFn, TakeFn};
use crate::ArrayData;

mod boolean;

mod fill;
pub mod filter;
mod flatten;
mod scalar_at;
mod slice;
mod take;

impl ArrayCompute for BoolArray {
fn and(&self) -> Option<&dyn AndFn> {
Some(self)
}
impl ArrayCompute for BoolArray {}

fn or(&self) -> Option<&dyn OrFn> {
Some(self)
impl ComputeVTable for BoolEncoding {
fn binary_boolean_fn(
&self,
_lhs: &ArrayData,
_rhs: &ArrayData,
) -> Option<&dyn BinaryBooleanFn<ArrayData>> {
// We only implement this when other is a constant value, otherwise we fall back to the
// default implementation that canonicalizes to Arrow.
// TODO(ngates): implement this for constants.
// other.is_constant().then_some(self)
lwwmanning marked this conversation as resolved.
Show resolved Hide resolved
gatesn marked this conversation as resolved.
Show resolved Hide resolved
None
}
}

impl ComputeVTable for BoolEncoding {
fn fill_forward_fn(&self) -> Option<&dyn FillForwardFn<ArrayData>> {
Some(self)
}
Expand Down
267 changes: 0 additions & 267 deletions vortex-array/src/array/constant/compute.rs

This file was deleted.

Loading
Loading