Skip to content

Commit a07dc84

Browse files
committed
CastFn
Signed-off-by: Nicholas Gates <[email protected]>
1 parent 50537f6 commit a07dc84

File tree

15 files changed

+159
-173
lines changed

15 files changed

+159
-173
lines changed

Cargo.lock

Lines changed: 21 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ tpchgen-arrow = { version = "2" }
206206
tracing = { version = "0.1.41" }
207207
tracing-perfetto = "0.1.5"
208208
tracing-subscriber = "0.3.20"
209+
type-map = "0.5.1"
209210
url = "2.5.7"
210211
uuid = { version = "1.18", features = ["js"] }
211212
walkdir = "2.5.0"

vortex-array/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ tabled = { workspace = true, optional = true, default-features = false, features
6161
"std",
6262
] }
6363
termtree = { workspace = true }
64+
type-map = { workspace = true }
6465
vortex-buffer = { workspace = true, features = ["arrow"] }
6566
vortex-compute = { workspace = true, default-features = true }
6667
vortex-dtype = { workspace = true, features = ["arrow", "serde"] }

vortex-array/src/arrays/bool/vtable/operator.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::execution::BatchKernelRef;
1515
use crate::execution::BindCtx;
1616
use crate::execution::kernel;
1717
use crate::optimizer::rules::ArrayParentReduceRule;
18+
use crate::optimizer::rules::Exact;
1819
use crate::vtable::OperatorVTable;
1920
use crate::vtable::ValidityHelper;
2021

@@ -47,7 +48,7 @@ impl OperatorVTable<BoolVTable> for BoolVTable {
4748
#[derive(Default, Debug)]
4849
pub struct BoolMaskedValidityRule;
4950

50-
impl ArrayParentReduceRule<BoolVTable, MaskedVTable> for BoolMaskedValidityRule {
51+
impl ArrayParentReduceRule<Exact<BoolVTable>, Exact<MaskedVTable>> for BoolMaskedValidityRule {
5152
fn reduce_parent(
5253
&self,
5354
array: &BoolArray,

vortex-array/src/arrays/decimal/vtable/operator.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::execution::BatchKernelRef;
1717
use crate::execution::BindCtx;
1818
use crate::execution::kernel;
1919
use crate::optimizer::rules::ArrayParentReduceRule;
20+
use crate::optimizer::rules::Exact;
2021
use crate::vtable::OperatorVTable;
2122
use crate::vtable::ValidityHelper;
2223

@@ -54,7 +55,9 @@ impl OperatorVTable<DecimalVTable> for DecimalVTable {
5455
#[derive(Default, Debug)]
5556
pub struct DecimalMaskedValidityRule;
5657

57-
impl ArrayParentReduceRule<DecimalVTable, MaskedVTable> for DecimalMaskedValidityRule {
58+
impl ArrayParentReduceRule<Exact<DecimalVTable>, Exact<MaskedVTable>>
59+
for DecimalMaskedValidityRule
60+
{
5861
fn reduce_parent(
5962
&self,
6063
array: &DecimalArray,

vortex-array/src/arrays/primitive/vtable/operator.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::execution::BatchKernelRef;
1717
use crate::execution::BindCtx;
1818
use crate::execution::kernel;
1919
use crate::optimizer::rules::ArrayParentReduceRule;
20+
use crate::optimizer::rules::Exact;
2021
use crate::vtable::OperatorVTable;
2122
use crate::vtable::ValidityHelper;
2223

@@ -52,7 +53,9 @@ impl OperatorVTable<PrimitiveVTable> for PrimitiveVTable {
5253
#[derive(Default, Debug)]
5354
pub struct PrimitiveMaskedValidityRule;
5455

55-
impl ArrayParentReduceRule<PrimitiveVTable, MaskedVTable> for PrimitiveMaskedValidityRule {
56+
impl ArrayParentReduceRule<Exact<PrimitiveVTable>, Exact<MaskedVTable>>
57+
for PrimitiveMaskedValidityRule
58+
{
5659
fn reduce_parent(
5760
&self,
5861
array: &PrimitiveArray,

vortex-array/src/expr/expression.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Expression {
5252
) -> VortexResult<Self> {
5353
let vtable = ExprVTable::new::<V>(vtable);
5454
let data = Arc::new(data);
55-
Self::try_new_erased(vtable, data.clone(), children.into())
55+
Self::try_new_erased(vtable, data, children.into())
5656
}
5757

5858
/// Create a new expression from a static vtable.

vortex-array/src/expr/functions/vtable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ impl fmt::Display for EmptyOptions {
334334

335335
pub trait ScalarFnVTableExt: VTable {
336336
/// Creates a new ScalarFn instance with the given options.
337-
fn new(self, options: Self::Options) -> ScalarFn {
337+
fn new_fn(self, options: Self::Options) -> ScalarFn {
338338
ScalarFn::new(self, options)
339339
}
340340

341341
/// Creates a new ScalarFn instance with the given options from a 'static vtable.
342-
fn new_static(&'static self, options: Self::Options) -> ScalarFn {
342+
fn new_fn_static(&'static self, options: Self::Options) -> ScalarFn {
343343
ScalarFn::new_static(self, options)
344344
}
345345
}

0 commit comments

Comments
 (0)