Skip to content

Commit 0ca42b1

Browse files
committed
feat[vortex-array]: add an expr array
Signed-off-by: Joe Isaacs <[email protected]>
1 parent d2af6a0 commit 0ca42b1

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ impl ArrayVTable<ExprVTable> for ExprVTable {
2828
array.child.array_hash(state, precision);
2929
array.dtype.hash(state);
3030
// TODO(joe): fixme
31-
array.expr.serialize_metadata().hash()
31+
array
32+
.expr
33+
.serialize_metadata()
34+
.unwrap_or(None)
35+
.unwrap_or(vec![])
36+
.hash(state)
3237
// Note: Expression doesn't implement Hash, so we skip it
3338
// This is acceptable since expressions are typically transient
3439
}
@@ -37,6 +42,6 @@ impl ArrayVTable<ExprVTable> for ExprVTable {
3742
array.child.array_eq(&other.child, precision)
3843
&& array.dtype == other.dtype
3944
// TODO(joe): fixme
40-
&& array.expr.serialize_metadata() == other.expr.serialize_metadata()
45+
&& array.expr.serialize_metadata().unwrap_or(None) == other.expr.serialize_metadata().unwrap_or(None)
4146
}
4247
}

vortex-array/src/arrays/expr/vtable/canonical.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod tests {
2828
use crate::expr::binary::checked_add;
2929
use crate::expr::literal::lit;
3030
use crate::validity::Validity;
31-
use crate::{Array, IntoArray};
31+
use crate::{Array, IntoArray, assert_arrays_eq};
3232

3333
#[test]
3434
fn test_expr_array_canonicalize() {
@@ -43,6 +43,6 @@ mod tests {
4343
let actual = expr_array.to_canonical().into_array();
4444

4545
let expect = (0..3).map(|_| 15i32).collect::<PrimitiveArray>();
46-
assert_eq!(expect, actual);
46+
assert_arrays_eq!(expect, actual);
4747
}
4848
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use vortex_error::VortexResult;
55

66
use crate::ArrayRef;
77
use crate::arrays::expr::{ExprArray, ExprVTable};
8-
use crate::execution::{BatchKernelRef, BindCtx};
98
use crate::expr::root;
109
use crate::expr::session::ExprSession;
1110
use crate::expr::transform::ExprOptimizer;

0 commit comments

Comments
 (0)