Skip to content

Commit 5febea4

Browse files
committed
Overtime events
1 parent 684c926 commit 5febea4

File tree

49 files changed

+263
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+263
-269
lines changed

vortex-array/src/compute/between.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use std::sync::LazyLock;
66

77
use arcref::ArcRef;
88
use vortex_dtype::DType;
9-
use vortex_error::{vortex_bail, vortex_err, VortexError, VortexExpect, VortexResult};
9+
use vortex_error::{VortexError, VortexExpect, VortexResult, vortex_bail, vortex_err};
1010
use vortex_scalar::Scalar;
1111

1212
use crate::arrays::ConstantArray;
1313
use crate::compute::{
14-
boolean, compare, BooleanOperator, ComputeFn, ComputeFnVTable, InvocationArgs, Kernel, Operator,
15-
Options, Output,
14+
BooleanOperator, ComputeFn, ComputeFnVTable, InvocationArgs, Kernel, Operator, Options, Output,
15+
boolean, compare,
1616
};
1717
use crate::vtable::VTable;
1818
use crate::{Array, ArrayRef, Canonical, IntoArray};
@@ -274,9 +274,9 @@ mod tests {
274274
use vortex_dtype::{Nullability, PType};
275275

276276
use super::*;
277+
use crate::ToCanonical;
277278
use crate::compute::conformance::search_sorted::rstest;
278279
use crate::test_harness::to_int_indices;
279-
use crate::ToCanonical;
280280

281281
#[rstest]
282282
#[case(StrictComparison::NonStrict, StrictComparison::NonStrict, vec![0, 1, 2, 3])]

vortex-array/src/compute/like.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ use std::sync::LazyLock;
66

77
use arcref::ArcRef;
88
use vortex_dtype::DType;
9-
use vortex_error::{vortex_bail, vortex_err, VortexError, VortexExpect, VortexResult};
9+
use vortex_error::{VortexError, VortexExpect, VortexResult, vortex_bail, vortex_err};
1010

11-
use crate::arrow::{from_arrow_array_with_len, Datum};
11+
use crate::arrow::{Datum, from_arrow_array_with_len};
1212
use crate::compute::{ComputeFn, ComputeFnVTable, InvocationArgs, Kernel, Options, Output};
1313
use crate::vtable::VTable;
1414
use crate::{Array, ArrayRef};

vortex-datafusion/src/convert/exprs.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ use arrow_schema::{DataType, Schema};
77
use datafusion_expr::Operator as DFOperator;
88
use datafusion_functions::core::getfield::GetFieldFunc;
99
use datafusion_physical_expr::{PhysicalExpr, ScalarFunctionExpr};
10-
use datafusion_physical_expr_common::physical_expr::{is_dynamic_physical_expr, PhysicalExprRef};
10+
use datafusion_physical_expr_common::physical_expr::{PhysicalExprRef, is_dynamic_physical_expr};
1111
use datafusion_physical_plan::expressions as df_expr;
1212
use itertools::Itertools;
1313
use vortex::compute::LikeOptions;
1414
use vortex::dtype::arrow::FromArrowType;
1515
use vortex::dtype::{DType, Nullability};
16-
use vortex::error::{vortex_bail, vortex_err, VortexResult};
16+
use vortex::error::{VortexResult, vortex_bail, vortex_err};
1717
use vortex::expr::{
18-
and, cast, get_item, is_null, list_contains, lit, not, root, Binary, Expression,
19-
Like, Operator, VTableExt,
18+
Binary, Expression, Like, Operator, VTableExt, and, cast, get_item, is_null, list_contains,
19+
lit, not, root,
2020
};
2121
use vortex::scalar::Scalar;
2222

@@ -43,7 +43,7 @@ impl TryFromDataFusion<dyn PhysicalExpr> for Expression {
4343
let right = Expression::try_from_df(binary_expr.right().as_ref())?;
4444
let operator = Operator::try_from_df(binary_expr.op())?;
4545

46-
return Ok(Binary.new(operator, [left, right]));
46+
return Ok(Binary.new_expr(operator, [left, right]));
4747
}
4848

4949
if let Some(col_expr) = df.as_any().downcast_ref::<df_expr::Column>() {
@@ -53,7 +53,7 @@ impl TryFromDataFusion<dyn PhysicalExpr> for Expression {
5353
if let Some(like) = df.as_any().downcast_ref::<df_expr::LikeExpr>() {
5454
let child = Expression::try_from_df(like.expr().as_ref())?;
5555
let pattern = Expression::try_from_df(like.pattern().as_ref())?;
56-
return Ok(Like.new(
56+
return Ok(Like.new_expr(
5757
LikeOptions {
5858
negated: like.negated(),
5959
case_insensitive: like.case_insensitive(),
@@ -283,8 +283,8 @@ mod tests {
283283

284284
use arrow_schema::{DataType, Field, Fields, Schema, TimeUnit as ArrowTimeUnit};
285285
use datafusion::functions::core::getfield::GetFieldFunc;
286-
use datafusion_common::config::ConfigOptions;
287286
use datafusion_common::ScalarValue;
287+
use datafusion_common::config::ConfigOptions;
288288
use datafusion_expr::{Operator as DFOperator, ScalarUDF};
289289
use datafusion_physical_expr::PhysicalExpr;
290290
use datafusion_physical_plan::expressions as df_expr;
@@ -404,7 +404,7 @@ mod tests {
404404
assert_snapshot!(result.display_tree().to_string(), @r#"
405405
vortex.binary =
406406
├── lhs: vortex.get_item "left"
407-
│ └── input: vortex.root
407+
│ └── input: vortex.root
408408
└── rhs: vortex.literal 42i32
409409
"#);
410410
}
@@ -427,7 +427,7 @@ mod tests {
427427
assert_snapshot!(result.display_tree().to_string(), @r#"
428428
vortex.like LikeOptions { negated: false, case_insensitive: false }
429429
├── child: vortex.get_item "text_col"
430-
│ └── input: vortex.root
430+
│ └── input: vortex.root
431431
└── pattern: vortex.literal "test%"
432432
"#);
433433
}

vortex-duckdb/src/convert/expr.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::sync::Arc;
66
use itertools::Itertools;
77
use vortex::compute::{BetweenOptions, LikeOptions, StrictComparison};
88
use vortex::dtype::Nullability;
9-
use vortex::error::{vortex_bail, vortex_err, VortexError, VortexExpect, VortexResult};
9+
use vortex::error::{VortexError, VortexExpect, VortexResult, vortex_bail, vortex_err};
1010
use vortex::expr::{
11-
and_collect, col, is_null, list_contains, lit, not, or_collect, Between, Binary, Expression,
12-
Like, Literal, Operator, VTableExt,
11+
Between, Binary, Expression, Like, Literal, Operator, VTableExt, and_collect, col, is_null,
12+
list_contains, lit, not, or_collect,
1313
};
1414
use vortex::scalar::Scalar;
1515

@@ -49,7 +49,7 @@ pub fn try_from_bound_expression(value: &duckdb::Expression) -> VortexResult<Opt
4949
return Ok(None);
5050
};
5151

52-
Binary.new(operator, [left, right])
52+
Binary.new_expr(operator, [left, right])
5353
}
5454
duckdb::ExpressionClass::BoundBetween(between) => {
5555
let Some(array) = try_from_bound_expression(&between.input)? else {
@@ -61,7 +61,7 @@ pub fn try_from_bound_expression(value: &duckdb::Expression) -> VortexResult<Opt
6161
let Some(upper) = try_from_bound_expression(&between.upper)? else {
6262
return Ok(None);
6363
};
64-
Between.new(
64+
Between.new_expr(
6565
BetweenOptions {
6666
lower_strict: if between.lower_inclusive {
6767
StrictComparison::NonStrict
@@ -144,7 +144,7 @@ pub fn try_from_bound_expression(value: &duckdb::Expression) -> VortexResult<Opt
144144
vortex_bail!("expected pattern to be bound string")
145145
};
146146
let pattern = lit(pattern_lit);
147-
Like.new(LikeOptions::default(), [value, pattern])
147+
Like.new_expr(LikeOptions::default(), [value, pattern])
148148
}
149149
_ => {
150150
log::debug!("bound function {}", func.scalar_function.name());

vortex-duckdb/src/convert/table_filter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::sync::Arc;
66
use itertools::Itertools;
77
use vortex::compute::Operator;
88
use vortex::dtype::{DType, Nullability};
9-
use vortex::error::{vortex_bail, VortexExpect, VortexResult};
9+
use vortex::error::{VortexExpect, VortexResult, vortex_bail};
1010
use vortex::expr::{
11-
and_collect, get_item, is_null, list_contains, lit, not, or_collect, Binary, Expression,
12-
VTableExt,
11+
Binary, Expression, VTableExt, and_collect, get_item, is_null, list_contains, lit, not,
12+
or_collect,
1313
};
1414
use vortex::scalar::Scalar;
1515

@@ -25,7 +25,7 @@ pub fn try_from_table_filter(
2525
TableFilterClass::ConstantComparison(const_) => {
2626
let scalar: Scalar = const_.value.try_into()?;
2727

28-
Binary.new(const_.operator.try_into()?, [col.clone(), lit(scalar)])
28+
Binary.new_expr(const_.operator.try_into()?, [col.clone(), lit(scalar)])
2929
}
3030
TableFilterClass::ConjunctionAnd(conj_and) => {
3131
let Some(children) = conj_and

vortex-duckdb/src/scan.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ use std::ffi::CString;
66
use std::fmt;
77
use std::fmt::{Debug, Formatter};
88
use std::pin::Pin;
9-
use std::sync::atomic::{AtomicU64, Ordering};
109
use std::sync::Arc;
10+
use std::sync::atomic::{AtomicU64, Ordering};
1111
use std::task::{Context, Poll};
1212

1313
use async_compat::Compat;
1414
use futures::stream::{BoxStream, SelectAll};
15-
use futures::{stream, FutureExt, Stream, StreamExt};
15+
use futures::{FutureExt, Stream, StreamExt, stream};
1616
use itertools::Itertools;
1717
use num_traits::AsPrimitive;
1818
use url::Url;
1919
use vortex::dtype::FieldNames;
20-
use vortex::error::{vortex_bail, vortex_err, VortexExpect, VortexResult};
21-
use vortex::expr::{and, and_collect, col, lit, root, select, Expression};
20+
use vortex::error::{VortexExpect, VortexResult, vortex_bail, vortex_err};
21+
use vortex::expr::{Expression, and, and_collect, col, lit, root, select};
2222
use vortex::file::{OpenOptionsSessionExt, VortexFile, VortexOpenOptions};
23-
use vortex::io::runtime::current::ThreadSafeIterator;
2423
use vortex::io::runtime::BlockingRuntime;
24+
use vortex::io::runtime::current::ThreadSafeIterator;
2525
use vortex::{ArrayRef, ToCanonical};
2626

2727
use crate::convert::{try_from_bound_expression, try_from_table_filter};
@@ -33,7 +33,7 @@ use crate::duckdb::{
3333
use crate::exporter::{ArrayExporter, ConversionCache};
3434
use crate::utils::glob::expand_glob;
3535
use crate::utils::object_store::s3_store;
36-
use crate::{duckdb, RUNTIME, SESSION};
36+
use crate::{RUNTIME, SESSION, duckdb};
3737

3838
pub struct VortexBindData {
3939
first_file: VortexFile,

vortex-expr/src/arbitrary.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use arbitrary::{Result as AResult, Unstructured};
77
use vortex_dtype::{DType, FieldName};
88
use vortex_scalar::arbitrary::random_scalar;
99

10-
use crate::{and_collect, col, lit, pack, Binary, Expression, Operator, VTableExt};
10+
use crate::{Binary, Expression, Operator, VTableExt, and_collect, col, lit, pack};
1111

1212
pub fn projection_expr(u: &mut Unstructured<'_>, dtype: &DType) -> AResult<Option<Expression>> {
1313
let Some(struct_dtype) = dtype.as_struct_fields_opt() else {
@@ -50,7 +50,7 @@ fn random_comparison(
5050
dtype: &DType,
5151
) -> AResult<Expression> {
5252
let scalar = random_scalar(u, dtype)?;
53-
Ok(Binary.new(
53+
Ok(Binary.new_expr(
5454
arbitrary_comparison_operator(u)?,
5555
[col(name.clone()), lit(scalar)],
5656
))

vortex-expr/src/display.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use crate::Expression;
54
use std::fmt::{Display, Formatter};
65

6+
use crate::Expression;
7+
78
pub enum DisplayFormat {
89
Compact,
910
Tree,
@@ -48,8 +49,6 @@ impl Display for ExpressionDebug<'_> {
4849

4950
#[cfg(test)]
5051
mod tests {
51-
use crate::exprs::pack::pack;
52-
use crate::exprs::select::select_exclude;
5352
use vortex_array::compute::{BetweenOptions, StrictComparison};
5453
use vortex_dtype::{DType, Nullability, PType};
5554

@@ -59,8 +58,9 @@ mod tests {
5958
use crate::exprs::get_item::get_item;
6059
use crate::exprs::literal::lit;
6160
use crate::exprs::not::not;
61+
use crate::exprs::pack::pack;
6262
use crate::exprs::root::root;
63-
use crate::exprs::select::select;
63+
use crate::exprs::select::{select, select_exclude};
6464

6565
#[test]
6666
fn tree_display_getitem() {

vortex-expr/src/exprs/between.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use prost::Message;
54
use std::fmt::Formatter;
6-
use vortex_array::compute::{between as between_compute, BetweenOptions};
5+
6+
use prost::Message;
77
use vortex_array::ArrayRef;
8+
use vortex_array::compute::{BetweenOptions, between as between_compute};
89
use vortex_dtype::DType;
910
use vortex_dtype::DType::Bool;
10-
use vortex_error::{vortex_bail, VortexExpect, VortexResult};
11+
use vortex_error::{VortexExpect, VortexResult, vortex_bail};
1112
use vortex_proto::expr as pb;
1213

1314
use crate::exprs::binary::Binary;
@@ -163,12 +164,12 @@ impl ExprInstance<'_, Between> {
163164
let lower = self.children()[1].clone();
164165
let upper = self.children()[2].clone();
165166

166-
let lhs = Binary.new(
167+
let lhs = Binary.new_expr(
167168
options.lower_strict.to_operator().into(),
168169
[lower, arr.clone()],
169170
);
170-
let rhs = Binary.new(options.upper_strict.to_operator().into(), [arr, upper]);
171-
Binary.new(Operator::And, [lhs, rhs])
171+
let rhs = Binary.new_expr(options.upper_strict.to_operator().into(), [arr, upper]);
172+
Binary.new_expr(Operator::And, [lhs, rhs])
172173
}
173174
}
174175

@@ -194,7 +195,7 @@ pub fn between(
194195
options: BetweenOptions,
195196
) -> Expression {
196197
Between
197-
.try_new(options, [arr.clone(), lower.clone(), upper.clone()])
198+
.try_new_expr(options, [arr, lower, upper])
198199
.vortex_expect("Failed to create Between expression")
199200
}
200201

0 commit comments

Comments
 (0)