Skip to content
Draft
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
6,876 changes: 56 additions & 6,820 deletions vortex-array/public-api.lock

Large diffs are not rendered by default.

19 changes: 7 additions & 12 deletions vortex-array/src/arrays/dict/compute/like.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,27 @@ use crate::Array;
use crate::ArrayRef;
use crate::IntoArray;
use crate::arrays::ConstantArray;
use crate::compute::LikeKernel;
use crate::compute::LikeKernelAdapter;
use crate::compute::LikeOptions;
use crate::compute::like;
use crate::register_kernel;
use crate::expr::LikeOptions;
use crate::expr::LikeReduce;
use crate::expr::like::arrow_like;

impl LikeKernel for DictVTable {
impl LikeReduce for DictVTable {
fn like(
&self,
array: &DictArray,
pattern: &dyn Array,
options: LikeOptions,
) -> VortexResult<Option<ArrayRef>> {
// if we have more values than codes, it is faster to canonicalise first.
// If we have more values than codes, it is faster to canonicalize first.
if array.values().len() > array.codes().len() {
return Ok(None);
}
if let Some(pattern) = pattern.as_constant() {
let pattern = ConstantArray::new(pattern, array.values().len()).into_array();
let values = like(array.values(), &pattern, options)?;
let values = arrow_like(array.values(), &pattern, options)?;

// SAFETY: LIKE preserves the len of the values, so codes are still pointing at
// valid positions.
// Preserve all_values_referenced since codes are unchanged
// Preserve all_values_referenced since codes are unchanged.
unsafe {
Ok(Some(
DictArray::new_unchecked(array.codes().clone(), values)
Expand All @@ -45,5 +42,3 @@ impl LikeKernel for DictVTable {
}
}
}

register_kernel!(LikeKernelAdapter(DictVTable).lift());
2 changes: 2 additions & 0 deletions vortex-array/src/arrays/dict/compute/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use crate::arrays::SliceReduceAdaptor;
use crate::builtins::ArrayBuiltins;
use crate::compute::CastReduceAdaptor;
use crate::expr::Cast;
use crate::expr::LikeReduceAdaptor;
use crate::expr::Pack;
use crate::optimizer::ArrayOptimizer;
use crate::optimizer::rules::ArrayParentReduceRule;
Expand All @@ -27,6 +28,7 @@ use crate::optimizer::rules::ParentRuleSet;
pub(crate) const PARENT_RULES: ParentRuleSet<DictVTable> = ParentRuleSet::new(&[
ParentRuleSet::lift(&FilterReduceAdaptor(DictVTable)),
ParentRuleSet::lift(&CastReduceAdaptor(DictVTable)),
ParentRuleSet::lift(&LikeReduceAdaptor(DictVTable)),
ParentRuleSet::lift(&DictionaryScalarFnValuesPushDownRule),
ParentRuleSet::lift(&DictionaryScalarFnCodesPullUpRule),
ParentRuleSet::lift(&SliceReduceAdaptor(DictVTable)),
Expand Down
231 changes: 0 additions & 231 deletions vortex-array/src/compute/like.rs

This file was deleted.

3 changes: 0 additions & 3 deletions vortex-array/src/compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub use invert::invert;
pub use is_constant::*;
pub use is_sorted::*;
use itertools::Itertools;
pub use like::*;
pub use list_contains::*;
pub use mask::*;
pub use min_max::*;
Expand Down Expand Up @@ -73,7 +72,6 @@ mod filter;
mod invert;
mod is_constant;
mod is_sorted;
mod like;
mod list_contains;
mod mask;
mod min_max;
Expand All @@ -99,7 +97,6 @@ pub fn warm_up_vtables() {
compare::warm_up_vtable();
is_constant::warm_up_vtable();
is_sorted::warm_up_vtable();
like::warm_up_vtable();
list_contains::warm_up_vtable();
mask::warm_up_vtable();
min_max::warm_up_vtable();
Expand Down
2 changes: 1 addition & 1 deletion vortex-array/src/expr/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl Expression {
/// # Example
///
/// ```rust
/// # use vortex_array::compute::LikeOptions;
/// # use vortex_array::expr::LikeOptions;
/// # use vortex_array::expr::VTableExt;
/// # use vortex_dtype::{DType, Nullability, PType};
/// # use vortex_array::expr::{and, cast, eq, get_item, gt, lit, not, root, select, Like};
Expand Down
Loading