Skip to content

Commit a58f2b0

Browse files
committed
wip
Signed-off-by: Joe Isaacs <[email protected]>
1 parent fff9247 commit a58f2b0

29 files changed

+142
-140
lines changed

fuzz/src/file/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
use libfuzzer_sys::arbitrary::{Arbitrary, Unstructured};
55
use vortex_array::ArrayRef;
66
use vortex_array::arrays::arbitrary::ArbitraryArray;
7-
use vortex_expr::Expression;
8-
use vortex_expr::arbitrary::{filter_expr, projection_expr};
7+
use vortex_array::expr::Expression;
8+
use vortex_array::expr::arbitrary::{filter_expr, projection_expr};
99

1010
use crate::array::CompressorStrategy;
1111

vortex-array/benches/expr/large_struct_pack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#![allow(clippy::unwrap_used)]
55

66
use divan::Bencher;
7+
use vortex_array::expr::{get_item, pack, root};
78
use vortex_dtype::{DType, FieldName, Nullability, PType, StructFields};
8-
use vortex_expr::{get_item, pack, root};
99

1010
fn main() {
1111
divan::main();

vortex-array/src/expr/expression.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use std::sync::Arc;
1010
use vortex_dtype::{DType, FieldPath};
1111
use vortex_error::{VortexExpect, VortexResult};
1212

13+
use crate::ArrayRef;
1314
use crate::expr::display::DisplayTreeExpr;
1415
use crate::expr::{ChildName, ExprId, ExprVTable, ExpressionView, StatsCatalog, VTable};
15-
use crate::{ArrayRef, display};
1616

1717
/// A node in a Vortex expression tree.
1818
///
@@ -215,10 +215,10 @@ impl Expression {
215215
/// # Example
216216
///
217217
/// ```rust
218-
/// # use crate::compute::LikeOptions;
219-
/// # use crate::vortex_expr::VTableExt;
218+
/// # use vortex_array::compute::LikeOptions;
219+
/// # use vortex_array::expr::VTableExt;
220220
/// # use vortex_dtype::{DType, Nullability, PType};
221-
/// # use vortex_expr::{and, cast, eq, get_item, gt, lit, not, root, select, Like};
221+
/// # use vortex_array::expr::{and, cast, eq, get_item, gt, lit, not, root, select, Like};
222222
/// // Build a complex nested expression
223223
/// let complex_expr = select(
224224
/// ["result"],

vortex-array/src/expr/exprs/between.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ use vortex_dtype::DType::Bool;
99
use vortex_error::{VortexExpect, VortexResult, vortex_bail};
1010
use vortex_proto::expr as pb;
1111

12+
use crate::ArrayRef;
1213
use crate::compute::{BetweenOptions, between as between_compute};
1314
use crate::expr::expression::Expression;
1415
use crate::expr::exprs::binary::Binary;
1516
use crate::expr::exprs::operators::Operator;
16-
use crate::{ArrayRef};
17-
use crate::expr::{ChildName, ExprId, ExpressionView, StatsCatalog, VTable, VTableExt}
17+
use crate::expr::{ChildName, ExprId, ExpressionView, StatsCatalog, VTable, VTableExt};
1818

1919
/// An optimized scalar expression to compute whether values fall between two bounds.
2020
///
@@ -50,14 +50,14 @@ impl VTable for Between {
5050
let opts = pb::BetweenOpts::decode(metadata)?;
5151
Ok(Some(BetweenOptions {
5252
lower_strict: if opts.lower_strict {
53-
vortex_array::compute::StrictComparison::Strict
53+
crate::compute::StrictComparison::Strict
5454
} else {
55-
vortex_array::compute::StrictComparison::NonStrict
55+
crate::compute::StrictComparison::NonStrict
5656
},
5757
upper_strict: if opts.upper_strict {
58-
vortex_array::compute::StrictComparison::Strict
58+
crate::compute::StrictComparison::Strict
5959
} else {
60-
vortex_array::compute::StrictComparison::NonStrict
60+
crate::compute::StrictComparison::NonStrict
6161
},
6262
}))
6363
}
@@ -179,9 +179,9 @@ impl ExpressionView<'_, Between> {
179179
/// The comparison strictness is controlled by the options parameter.
180180
///
181181
/// ```rust
182-
/// # use crate::compute::BetweenOptions;
183-
/// # use crate::compute::StrictComparison;
184-
/// # use vortex_expr::{between, lit, root};
182+
/// # use vortex_array::compute::BetweenOptions;
183+
/// # use vortex_array::compute::StrictComparison;
184+
/// # use vortex_array::expr::{between, lit, root};
185185
/// let opts = BetweenOptions {
186186
/// lower_strict: StrictComparison::NonStrict,
187187
/// upper_strict: StrictComparison::NonStrict,

vortex-array/src/expr/exprs/binary.rs

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ use crate::compute::{add, and_kleene, compare, div, mul, or_kleene, sub};
1212
use crate::expr::expression::Expression;
1313
use crate::expr::exprs::literal::lit;
1414
use crate::expr::exprs::operators::Operator;
15-
use crate::{
16-
ArrayRef, ChildName, ExprId, ExpressionView, StatsCatalog, VTable, VTableExt, compute,
17-
};
15+
use crate::expr::{ChildName, ExprId, ExpressionView, StatsCatalog, VTable, VTableExt};
16+
use crate::{ArrayRef, compute};
1817

1918
pub struct Binary;
2019

@@ -259,11 +258,11 @@ impl ExpressionView<'_, Binary> {
259258
/// ## Example usage
260259
///
261260
/// ```
262-
/// # use crate::arrays::{BoolArray, PrimitiveArray };
263-
/// # use crate::{Array, IntoArray, ToCanonical};
264-
/// # use crate::validity::Validity;
261+
/// # use vortex_array::arrays::{BoolArray, PrimitiveArray };
262+
/// # use vortex_array::{Array, IntoArray, ToCanonical};
263+
/// # use vortex_array::validity::Validity;
265264
/// # use vortex_buffer::buffer;
266-
/// # use vortex_expr::{eq, root, lit};
265+
/// # use vortex_array::expr::{eq, root, lit};
267266
/// let xs = PrimitiveArray::new(buffer![1i32, 2i32, 3i32], Validity::NonNullable);
268267
/// let result = eq(root(), lit(3)).evaluate(&xs.to_array()).unwrap();
269268
///
@@ -283,11 +282,11 @@ pub fn eq(lhs: Expression, rhs: Expression) -> Expression {
283282
/// ## Example usage
284283
///
285284
/// ```
286-
/// # use crate::arrays::{BoolArray, PrimitiveArray };
287-
/// # use crate::{IntoArray, ToCanonical};
288-
/// # use crate::validity::Validity;
285+
/// # use vortex_array::arrays::{BoolArray, PrimitiveArray };
286+
/// # use vortex_array::{IntoArray, ToCanonical};
287+
/// # use vortex_array::validity::Validity;
289288
/// # use vortex_buffer::buffer;
290-
/// # use vortex_expr::{root, lit, not_eq};
289+
/// # use vortex_array::expr::{root, lit, not_eq};
291290
/// let xs = PrimitiveArray::new(buffer![1i32, 2i32, 3i32], Validity::NonNullable);
292291
/// let result = not_eq(root(), lit(3)).evaluate(&xs.to_array()).unwrap();
293292
///
@@ -307,11 +306,11 @@ pub fn not_eq(lhs: Expression, rhs: Expression) -> Expression {
307306
/// ## Example usage
308307
///
309308
/// ```
310-
/// # use crate::arrays::{BoolArray, PrimitiveArray };
311-
/// # use crate::{IntoArray, ToCanonical};
312-
/// # use crate::validity::Validity;
309+
/// # use vortex_array::arrays::{BoolArray, PrimitiveArray };
310+
/// # use vortex_array::{IntoArray, ToCanonical};
311+
/// # use vortex_array::validity::Validity;
313312
/// # use vortex_buffer::buffer;
314-
/// # use vortex_expr::{gt_eq, root, lit};
313+
/// # use vortex_array::expr::{gt_eq, root, lit};
315314
/// let xs = PrimitiveArray::new(buffer![1i32, 2i32, 3i32], Validity::NonNullable);
316315
/// let result = gt_eq(root(), lit(3)).evaluate(&xs.to_array()).unwrap();
317316
///
@@ -331,11 +330,11 @@ pub fn gt_eq(lhs: Expression, rhs: Expression) -> Expression {
331330
/// ## Example usage
332331
///
333332
/// ```
334-
/// # use crate::arrays::{BoolArray, PrimitiveArray };
335-
/// # use crate::{IntoArray, ToCanonical};
336-
/// # use crate::validity::Validity;
333+
/// # use vortex_array::arrays::{BoolArray, PrimitiveArray };
334+
/// # use vortex_array::{IntoArray, ToCanonical};
335+
/// # use vortex_array::validity::Validity;
337336
/// # use vortex_buffer::buffer;
338-
/// # use vortex_expr::{gt, root, lit};
337+
/// # use vortex_array::expr::{gt, root, lit};
339338
/// let xs = PrimitiveArray::new(buffer![1i32, 2i32, 3i32], Validity::NonNullable);
340339
/// let result = gt(root(), lit(2)).evaluate(&xs.to_array()).unwrap();
341340
///
@@ -355,11 +354,11 @@ pub fn gt(lhs: Expression, rhs: Expression) -> Expression {
355354
/// ## Example usage
356355
///
357356
/// ```
358-
/// # use crate::arrays::{BoolArray, PrimitiveArray };
359-
/// # use crate::{IntoArray, ToCanonical};
360-
/// # use crate::validity::Validity;
357+
/// # use vortex_array::arrays::{BoolArray, PrimitiveArray };
358+
/// # use vortex_array::{IntoArray, ToCanonical};
359+
/// # use vortex_array::validity::Validity;
361360
/// # use vortex_buffer::buffer;
362-
/// # use vortex_expr::{root, lit, lt_eq};
361+
/// # use vortex_array::expr::{root, lit, lt_eq};
363362
/// let xs = PrimitiveArray::new(buffer![1i32, 2i32, 3i32], Validity::NonNullable);
364363
/// let result = lt_eq(root(), lit(2)).evaluate(&xs.to_array()).unwrap();
365364
///
@@ -379,11 +378,11 @@ pub fn lt_eq(lhs: Expression, rhs: Expression) -> Expression {
379378
/// ## Example usage
380379
///
381380
/// ```
382-
/// # use crate::arrays::{BoolArray, PrimitiveArray };
383-
/// # use crate::{IntoArray, ToCanonical};
384-
/// # use crate::validity::Validity;
381+
/// # use vortex_array::arrays::{BoolArray, PrimitiveArray };
382+
/// # use vortex_array::{IntoArray, ToCanonical};
383+
/// # use vortex_array::validity::Validity;
385384
/// # use vortex_buffer::buffer;
386-
/// # use vortex_expr::{root, lit, lt};
385+
/// # use vortex_array::expr::{root, lit, lt};
387386
/// let xs = PrimitiveArray::new(buffer![1i32, 2i32, 3i32], Validity::NonNullable);
388387
/// let result = lt(root(), lit(3)).evaluate(&xs.to_array()).unwrap();
389388
///
@@ -403,9 +402,9 @@ pub fn lt(lhs: Expression, rhs: Expression) -> Expression {
403402
/// ## Example usage
404403
///
405404
/// ```
406-
/// # use crate::arrays::BoolArray;
407-
/// # use crate::{IntoArray, ToCanonical};
408-
/// # use vortex_expr::{root, lit, or};
405+
/// # use vortex_array::arrays::BoolArray;
406+
/// # use vortex_array::{IntoArray, ToCanonical};
407+
/// # use vortex_array::expr::{root, lit, or};
409408
/// let xs = BoolArray::from_iter(vec![true, false, true]);
410409
/// let result = or(root(), lit(false)).evaluate(&xs.to_array()).unwrap();
411410
///
@@ -437,9 +436,9 @@ where
437436
/// ## Example usage
438437
///
439438
/// ```
440-
/// # use crate::arrays::BoolArray;
441-
/// # use crate::{IntoArray, ToCanonical};
442-
/// # use vortex_expr::{and, root, lit};
439+
/// # use vortex_array::arrays::BoolArray;
440+
/// # use vortex_array::{IntoArray, ToCanonical};
441+
/// # use vortex_array::expr::{and, root, lit};
443442
/// let xs = BoolArray::from_iter(vec![true, false, true]);
444443
/// let result = and(root(), lit(true)).evaluate(&xs.to_array()).unwrap();
445444
///
@@ -481,10 +480,10 @@ where
481480
/// ## Example usage
482481
///
483482
/// ```
484-
/// # use crate::IntoArray;
485-
/// # use crate::arrow::IntoArrowArray as _;
483+
/// # use vortex_array::IntoArray;
484+
/// # use vortex_array::arrow::IntoArrowArray as _;
486485
/// # use vortex_buffer::buffer;
487-
/// # use vortex_expr::{checked_add, lit, root};
486+
/// # use vortex_array::expr::{checked_add, lit, root};
488487
/// let xs = buffer![1, 2, 3].into_array();
489488
/// let result = checked_add(root(), lit(5))
490489
/// .evaluate(&xs.to_array())
@@ -511,7 +510,7 @@ mod tests {
511510
use super::{and, and_collect, and_collect_right, eq, gt, gt_eq, lt, lt_eq, not_eq, or};
512511
use crate::expr::exprs::get_item::col;
513512
use crate::expr::exprs::literal::lit;
514-
use crate::{Expression, test_harness};
513+
use crate::expr::{Expression, test_harness};
515514

516515
#[test]
517516
fn and_collect_left_assoc() {

vortex-array/src/expr/exprs/cast.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ use vortex_dtype::{DType, FieldPath};
99
use vortex_error::{VortexExpect, VortexResult, vortex_bail, vortex_err};
1010
use vortex_proto::expr as pb;
1111

12+
use crate::ArrayRef;
1213
use crate::compute::cast as compute_cast;
1314
use crate::expr::expression::Expression;
14-
use crate::{ArrayRef, ChildName, ExprId, ExpressionView, StatsCatalog, VTable, VTableExt};
15+
use crate::expr::{ChildName, ExprId, ExpressionView, StatsCatalog, VTable, VTableExt};
1516

1617
/// A cast expression that converts values to a target data type.
1718
pub struct Cast;
@@ -120,7 +121,7 @@ impl VTable for Cast {
120121
///
121122
/// ```rust
122123
/// # use vortex_dtype::{DType, Nullability, PType};
123-
/// # use vortex_expr::{cast, root};
124+
/// # use vortex_array::expr::{cast, root};
124125
/// let expr = cast(root(), DType::Primitive(PType::I64, Nullability::NonNullable));
125126
/// ```
126127
pub fn cast(child: Expression, target: DType) -> Expression {
@@ -138,7 +139,9 @@ mod tests {
138139
use crate::arrays::StructArray;
139140
use crate::expr::exprs::get_item::get_item;
140141
use crate::expr::exprs::root::root;
141-
use crate::{Expression, IntoArray, test_harness};
142+
use crate::expr::Expression;
143+
use crate::expr::test_harness;
144+
use crate::IntoArray;
142145

143146
#[test]
144147
fn dtype() {

vortex-array/src/expr/exprs/dynamic.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ use vortex_scalar::{Scalar, ScalarValue};
1313
use crate::arrays::ConstantArray;
1414
use crate::compute::{Operator, compare};
1515
use crate::expr::traversal::{NodeExt, NodeVisitor, TraversalOrder};
16-
use crate::{
17-
Array, ArrayRef, ChildName, ExprId, Expression, ExpressionView, IntoArray, StatsCatalog,
18-
VTable, VTableExt,
19-
};
16+
use crate::expr::{ChildName, ExprId, Expression, ExpressionView, StatsCatalog, VTable, VTableExt};
17+
use crate::{Array, ArrayRef, IntoArray};
2018

2119
/// A dynamic comparison expression can be used to capture a comparison to a value that can change
2220
/// during the execution of a query, such as when a compute engine pushes down an ORDER BY + LIMIT

vortex-array/src/expr/exprs/get_item.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ use vortex_proto::expr as pb;
1111

1212
use crate::compute::mask;
1313
use crate::expr::exprs::root::root;
14+
use crate::expr::{ChildName, ExprId, Expression, ExpressionView, StatsCatalog, VTable, VTableExt};
1415
use crate::stats::Stat;
15-
use crate::{
16-
ArrayRef, ToCanonical,
17-
};
18-
use crate::expr::{ChildName, ExprId, Expression, ExpressionView, StatsCatalog,VTable, VTableExt}
16+
use crate::{ArrayRef, ToCanonical};
1917

2018
pub struct GetItem;
2119

@@ -132,7 +130,7 @@ impl VTable for GetItem {
132130
/// Equivalent to `get_item(field, root())` - extracts a named field from the input array.
133131
///
134132
/// ```rust
135-
/// # use vortex_expr::col;
133+
/// # use vortex_array::expr::col;
136134
/// let expr = col("name");
137135
/// ```
138136
pub fn col(field: impl Into<FieldName>) -> Expression {
@@ -144,7 +142,7 @@ pub fn col(field: impl Into<FieldName>) -> Expression {
144142
/// Accesses the specified field from the result of the child expression.
145143
///
146144
/// ```rust
147-
/// # use vortex_expr::{get_item, root};
145+
/// # use vortex_array::expr::{get_item, root};
148146
/// let expr = get_item("user_id", root());
149147
/// ```
150148
pub fn get_item(field: impl Into<FieldName>, child: Expression) -> Expression {

vortex-array/src/expr/exprs/is_null.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ use vortex_mask::Mask;
1111
use crate::arrays::{BoolArray, ConstantArray};
1212
use crate::expr::exprs::binary::eq;
1313
use crate::expr::exprs::literal::lit;
14+
use crate::expr::{ChildName, ExprId, Expression, ExpressionView, StatsCatalog, VTable, VTableExt};
1415
use crate::stats::Stat;
15-
use crate::{
16-
Array, ArrayRef, ChildName, ExprId, Expression, ExpressionView, IntoArray, StatsCatalog,
17-
VTable, VTableExt,
18-
};
16+
use crate::{Array, ArrayRef, IntoArray};
1917

2018
/// Expression that checks for null values.
2119
pub struct IsNull;
@@ -87,7 +85,7 @@ impl VTable for IsNull {
8785
/// Returns a boolean array indicating which positions contain null values.
8886
///
8987
/// ```rust
90-
/// # use vortex_expr::{is_null, root};
88+
/// # use vortex_array::expr::{is_null, root};
9189
/// let expr = is_null(root());
9290
/// ```
9391
pub fn is_null(child: Expression) -> Expression {
@@ -108,9 +106,11 @@ mod tests {
108106
use crate::expr::exprs::get_item::{col, get_item};
109107
use crate::expr::exprs::literal::lit;
110108
use crate::expr::exprs::root::root;
111-
use crate::pruning::checked_pruning_expr;
109+
use crate::expr::pruning::checked_pruning_expr;
110+
use crate::expr::test_harness;
112111
use crate::stats::Stat;
113-
use crate::{HashSet, IntoArray, test_harness};
112+
use crate::IntoArray;
113+
use vortex_utils::aliases::hash_set::HashSet;
114114

115115
#[test]
116116
fn dtype() {

vortex-array/src/expr/exprs/like.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ use vortex_dtype::DType;
88
use vortex_error::{VortexResult, vortex_bail};
99
use vortex_proto::expr as pb;
1010

11+
use crate::ArrayRef;
1112
use crate::compute::{LikeOptions, like as like_compute};
12-
use crate::{ArrayRef, ChildName, ExprId, Expression, ExpressionView, VTable, VTableExt};
13+
use crate::expr::{ChildName, ExprId, Expression, ExpressionView, VTable, VTableExt};
1314

1415
/// Expression that performs SQL LIKE pattern matching.
1516
pub struct Like;

0 commit comments

Comments
 (0)