diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index d5ab9cc61f8..1a7102a131a 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -16176,7 +16176,7 @@ pub fn vortex_array::scalar_fn::fns::fill_null::FillNull::deserialize(&self, _me pub fn vortex_array::scalar_fn::fns::fill_null::FillNull::execute(&self, _options: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::fill_null::FillNull::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::fill_null::FillNull::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::fill_null::FillNull::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -16332,7 +16332,7 @@ pub fn vortex_array::scalar_fn::fns::is_null::IsNull::deserialize(&self, _metada pub fn vortex_array::scalar_fn::fns::is_null::IsNull::execute(&self, _data: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::is_null::IsNull::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::is_null::IsNull::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::is_null::IsNull::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -16504,7 +16504,7 @@ pub fn vortex_array::scalar_fn::fns::list_contains::ListContains::deserialize(&s pub fn vortex_array::scalar_fn::fns::list_contains::ListContains::execute(&self, _options: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::list_contains::ListContains::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::list_contains::ListContains::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::list_contains::ListContains::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -16636,7 +16636,7 @@ pub fn vortex_array::scalar_fn::fns::mask::Mask::deserialize(&self, _metadata: & pub fn vortex_array::scalar_fn::fns::mask::Mask::execute(&self, _options: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::mask::Mask::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::mask::Mask::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::mask::Mask::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -16814,7 +16814,7 @@ pub fn vortex_array::scalar_fn::fns::merge::Merge::deserialize(&self, _metadata: pub fn vortex_array::scalar_fn::fns::merge::Merge::execute(&self, options: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::merge::Merge::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::merge::Merge::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::merge::Merge::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -16860,7 +16860,7 @@ pub fn vortex_array::scalar_fn::fns::not::Not::deserialize(&self, _metadata: &[u pub fn vortex_array::scalar_fn::fns::not::Not::execute(&self, _data: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::not::Not::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::not::Not::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::not::Not::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -18030,7 +18030,7 @@ pub fn vortex_array::scalar_fn::fns::fill_null::FillNull::deserialize(&self, _me pub fn vortex_array::scalar_fn::fns::fill_null::FillNull::execute(&self, _options: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::fill_null::FillNull::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::fill_null::FillNull::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::fill_null::FillNull::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -18106,7 +18106,7 @@ pub fn vortex_array::scalar_fn::fns::is_null::IsNull::deserialize(&self, _metada pub fn vortex_array::scalar_fn::fns::is_null::IsNull::execute(&self, _data: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::is_null::IsNull::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::is_null::IsNull::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::is_null::IsNull::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -18182,7 +18182,7 @@ pub fn vortex_array::scalar_fn::fns::list_contains::ListContains::deserialize(&s pub fn vortex_array::scalar_fn::fns::list_contains::ListContains::execute(&self, _options: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::list_contains::ListContains::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::list_contains::ListContains::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::list_contains::ListContains::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -18258,7 +18258,7 @@ pub fn vortex_array::scalar_fn::fns::mask::Mask::deserialize(&self, _metadata: & pub fn vortex_array::scalar_fn::fns::mask::Mask::execute(&self, _options: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::mask::Mask::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::mask::Mask::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::mask::Mask::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -18296,7 +18296,7 @@ pub fn vortex_array::scalar_fn::fns::merge::Merge::deserialize(&self, _metadata: pub fn vortex_array::scalar_fn::fns::merge::Merge::execute(&self, options: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::merge::Merge::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::merge::Merge::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::merge::Merge::id(&self) -> vortex_array::scalar_fn::ScalarFnId @@ -18334,7 +18334,7 @@ pub fn vortex_array::scalar_fn::fns::not::Not::deserialize(&self, _metadata: &[u pub fn vortex_array::scalar_fn::fns::not::Not::execute(&self, _data: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::scalar_fn::fns::not::Not::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::scalar_fn::fns::not::Not::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn vortex_array::scalar_fn::fns::not::Not::id(&self) -> vortex_array::scalar_fn::ScalarFnId diff --git a/vortex-array/src/expr/mod.rs b/vortex-array/src/expr/mod.rs index 9d973a01cae..a5d32510443 100644 --- a/vortex-array/src/expr/mod.rs +++ b/vortex-array/src/expr/mod.rs @@ -207,7 +207,7 @@ mod tests { "(($.col1 < $.col2) or ($.col1 != $.col2))" ); - assert_eq!(not(col1).to_string(), "not($.col1)"); + assert_eq!(not(col1).to_string(), "vortex.not($.col1)"); assert_eq!( select(vec![FieldName::from("col1")], root()).to_string(), diff --git a/vortex-array/src/scalar_fn/fns/fill_null/mod.rs b/vortex-array/src/scalar_fn/fns/fill_null/mod.rs index 656029bf82d..d27b3f49d37 100644 --- a/vortex-array/src/scalar_fn/fns/fill_null/mod.rs +++ b/vortex-array/src/scalar_fn/fns/fill_null/mod.rs @@ -3,8 +3,6 @@ mod kernel; -use std::fmt::Formatter; - pub use kernel::*; use vortex_error::VortexResult; use vortex_error::vortex_bail; @@ -66,19 +64,6 @@ impl ScalarFnVTable for FillNull { } } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> std::fmt::Result { - write!(f, "fill_null(")?; - expr.child(0).fmt_sql(f)?; - write!(f, ", ")?; - expr.child(1).fmt_sql(f)?; - write!(f, ")") - } - fn return_dtype(&self, _options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult { vortex_ensure!( arg_dtypes[0].eq_ignore_nullability(&arg_dtypes[1]), @@ -265,6 +250,6 @@ mod tests { #[test] fn test_display() { let expr = fill_null(get_item("value", root()), lit(0i32)); - assert_eq!(expr.to_string(), "fill_null($.value, 0i32)"); + assert_eq!(expr.to_string(), "vortex.fill_null($.value, 0i32)"); } } diff --git a/vortex-array/src/scalar_fn/fns/is_null.rs b/vortex-array/src/scalar_fn/fns/is_null.rs index dd3ef3366c6..c2f78db9718 100644 --- a/vortex-array/src/scalar_fn/fns/is_null.rs +++ b/vortex-array/src/scalar_fn/fns/is_null.rs @@ -1,8 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use std::fmt::Formatter; - use vortex_error::VortexResult; use vortex_session::VortexSession; @@ -60,17 +58,6 @@ impl ScalarFnVTable for IsNull { } } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> std::fmt::Result { - write!(f, "is_null(")?; - expr.child(0).fmt_sql(f)?; - write!(f, ")") - } - fn return_dtype(&self, _options: &Self::Options, _arg_dtypes: &[DType]) -> VortexResult { Ok(DType::Bool(Nullability::NonNullable)) } @@ -240,10 +227,10 @@ mod tests { #[test] fn test_display() { let expr = is_null(get_item("name", root())); - assert_eq!(expr.to_string(), "is_null($.name)"); + assert_eq!(expr.to_string(), "vortex.is_null($.name)"); let expr2 = is_null(root()); - assert_eq!(expr2.to_string(), "is_null($)"); + assert_eq!(expr2.to_string(), "vortex.is_null($)"); } #[test] diff --git a/vortex-array/src/scalar_fn/fns/list_contains/mod.rs b/vortex-array/src/scalar_fn/fns/list_contains/mod.rs index b4d6c3e6bc4..930a340e85f 100644 --- a/vortex-array/src/scalar_fn/fns/list_contains/mod.rs +++ b/vortex-array/src/scalar_fn/fns/list_contains/mod.rs @@ -3,7 +3,6 @@ mod kernel; -use std::fmt::Formatter; use std::ops::BitOr; use arrow_buffer::bit_iterator::BitIndexIterator; @@ -89,19 +88,6 @@ impl ScalarFnVTable for ListContains { ), } } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> std::fmt::Result { - write!(f, "contains(")?; - expr.child(0).fmt_sql(f)?; - write!(f, ", ")?; - expr.child(1).fmt_sql(f)?; - write!(f, ")") - } - fn return_dtype(&self, _options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult { let list_dtype = &arg_dtypes[0]; let needle_dtype = &arg_dtypes[1]; @@ -655,10 +641,10 @@ mod tests { #[test] pub fn test_display() { let expr = list_contains(get_item("tags", root()), lit("urgent")); - assert_eq!(expr.to_string(), "contains($.tags, \"urgent\")"); + assert_eq!(expr.to_string(), "vortex.list.contains($.tags, \"urgent\")"); let expr2 = list_contains(root(), lit(42)); - assert_eq!(expr2.to_string(), "contains($, 42i32)"); + assert_eq!(expr2.to_string(), "vortex.list.contains($, 42i32)"); } #[test] diff --git a/vortex-array/src/scalar_fn/fns/mask/mod.rs b/vortex-array/src/scalar_fn/fns/mask/mod.rs index eaf83307b35..608d6523ae4 100644 --- a/vortex-array/src/scalar_fn/fns/mask/mod.rs +++ b/vortex-array/src/scalar_fn/fns/mask/mod.rs @@ -2,7 +2,6 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod kernel; -use std::fmt::Formatter; pub use kernel::*; use vortex_error::VortexExpect; @@ -73,19 +72,6 @@ impl ScalarFnVTable for Mask { } } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> std::fmt::Result { - write!(f, "mask(")?; - expr.child(0).fmt_sql(f)?; - write!(f, ", ")?; - expr.child(1).fmt_sql(f)?; - write!(f, ")") - } - fn return_dtype(&self, _options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult { vortex_ensure!( arg_dtypes[1] == DType::Bool(Nullability::NonNullable), diff --git a/vortex-array/src/scalar_fn/fns/merge.rs b/vortex-array/src/scalar_fn/fns/merge.rs index 01445eb6c54..01775705140 100644 --- a/vortex-array/src/scalar_fn/fns/merge.rs +++ b/vortex-array/src/scalar_fn/fns/merge.rs @@ -84,22 +84,6 @@ impl ScalarFnVTable for Merge { ChildName::from(Arc::from(format!("{}", child_idx))) } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> std::fmt::Result { - write!(f, "merge(")?; - for (i, child) in expr.children().iter().enumerate() { - child.fmt_sql(f)?; - if i + 1 < expr.children().len() { - write!(f, ", ")?; - } - } - write!(f, ")") - } - fn return_dtype(&self, options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult { let mut field_names = Vec::new(); let mut arrays = Vec::new(); @@ -540,10 +524,13 @@ mod tests { #[test] pub fn test_display() { let expr = merge([get_item("struct1", root()), get_item("struct2", root())]); - assert_eq!(expr.to_string(), "merge($.struct1, $.struct2)"); + assert_eq!( + expr.to_string(), + "vortex.merge($.struct1, $.struct2, opts=Error)" + ); let expr2 = merge(vec![get_item("a", root())]); - assert_eq!(expr2.to_string(), "merge($.a)"); + assert_eq!(expr2.to_string(), "vortex.merge($.a, opts=Error)"); } #[test] diff --git a/vortex-array/src/scalar_fn/fns/not/mod.rs b/vortex-array/src/scalar_fn/fns/not/mod.rs index c70c8794fe6..d7706f20c23 100644 --- a/vortex-array/src/scalar_fn/fns/not/mod.rs +++ b/vortex-array/src/scalar_fn/fns/not/mod.rs @@ -3,8 +3,6 @@ mod kernel; -use std::fmt::Formatter; - pub use kernel::*; use vortex_error::VortexResult; use vortex_error::vortex_bail; @@ -19,7 +17,6 @@ use crate::arrays::ConstantArray; use crate::arrays::bool::BoolArrayExt; use crate::builtins::ArrayBuiltins; use crate::dtype::DType; -use crate::expr::Expression; use crate::scalar::Scalar; use crate::scalar_fn::Arity; use crate::scalar_fn::ChildName; @@ -62,17 +59,6 @@ impl ScalarFnVTable for Not { } } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> std::fmt::Result { - write!(f, "not(")?; - expr.child(0).fmt_sql(f)?; - write!(f, ")") - } - fn return_dtype(&self, _options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult { let child_dtype = &arg_dtypes[0]; if !matches!(child_dtype, DType::Bool(_)) { @@ -155,8 +141,8 @@ mod tests { let a = not(get_item("a", root())); let b = get_item("a", not(root())); assert_ne!(a.to_string(), b.to_string()); - assert_eq!(a.to_string(), "not($.a)"); - assert_eq!(b.to_string(), "not($).a"); + assert_eq!(a.to_string(), "vortex.not($.a)"); + assert_eq!(b.to_string(), "vortex.not($).a"); } #[test] diff --git a/vortex-array/src/scalar_fn/vtable.rs b/vortex-array/src/scalar_fn/vtable.rs index c9588e8aa13..c93524717a0 100644 --- a/vortex-array/src/scalar_fn/vtable.rs +++ b/vortex-array/src/scalar_fn/vtable.rs @@ -22,6 +22,7 @@ use crate::dtype::DType; use crate::expr::Expression; use crate::expr::StatsCatalog; use crate::expr::stats::Stat; +use crate::expr::traversal::Node; use crate::scalar_fn::ScalarFn; use crate::scalar_fn::ScalarFnId; use crate::scalar_fn::ScalarFnRef; @@ -77,7 +78,21 @@ pub trait ScalarFnVTable: 'static + Sized + Clone + Send + Sync { options: &Self::Options, expr: &Expression, f: &mut Formatter<'_>, - ) -> fmt::Result; + ) -> fmt::Result { + write!(f, "{}(", self.id())?; + let nchildren = expr.children_count(); + for (i, child) in expr.children().iter().enumerate() { + child.fmt_sql(f)?; + if i + 1 < nchildren { + write!(f, ", ")?; + } + } + let opts = format!("{}", options); + if !opts.is_empty() { + write!(f, ", opts={}", opts)?; + } + write!(f, ")") + } /// Coerce the arguments of this function. /// diff --git a/vortex-tensor/public-api.lock b/vortex-tensor/public-api.lock index bec8df1cb29..61944bce1ba 100644 --- a/vortex-tensor/public-api.lock +++ b/vortex-tensor/public-api.lock @@ -258,8 +258,6 @@ pub fn vortex_tensor::scalar_fns::cosine_similarity::CosineSimilarity::child_nam pub fn vortex_tensor::scalar_fns::cosine_similarity::CosineSimilarity::execute(&self, _options: &Self::Options, args: &dyn vortex_array::scalar_fn::vtable::ExecutionArgs, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_tensor::scalar_fns::cosine_similarity::CosineSimilarity::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::expression::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - pub fn vortex_tensor::scalar_fns::cosine_similarity::CosineSimilarity::id(&self) -> vortex_array::scalar_fn::ScalarFnId pub fn vortex_tensor::scalar_fns::cosine_similarity::CosineSimilarity::is_fallible(&self, _options: &Self::Options) -> bool @@ -294,8 +292,6 @@ pub fn vortex_tensor::scalar_fns::inner_product::InnerProduct::child_name(&self, pub fn vortex_tensor::scalar_fns::inner_product::InnerProduct::execute(&self, _options: &Self::Options, args: &dyn vortex_array::scalar_fn::vtable::ExecutionArgs, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_tensor::scalar_fns::inner_product::InnerProduct::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::expression::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - pub fn vortex_tensor::scalar_fns::inner_product::InnerProduct::id(&self) -> vortex_array::scalar_fn::ScalarFnId pub fn vortex_tensor::scalar_fns::inner_product::InnerProduct::is_fallible(&self, _options: &Self::Options) -> bool @@ -332,8 +328,6 @@ pub fn vortex_tensor::scalar_fns::l2_denorm::L2Denorm::child_name(&self, _option pub fn vortex_tensor::scalar_fns::l2_denorm::L2Denorm::execute(&self, _options: &Self::Options, args: &dyn vortex_array::scalar_fn::vtable::ExecutionArgs, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_tensor::scalar_fns::l2_denorm::L2Denorm::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::expression::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - pub fn vortex_tensor::scalar_fns::l2_denorm::L2Denorm::id(&self) -> vortex_array::scalar_fn::ScalarFnId pub fn vortex_tensor::scalar_fns::l2_denorm::L2Denorm::is_fallible(&self, _options: &Self::Options) -> bool @@ -372,8 +366,6 @@ pub fn vortex_tensor::scalar_fns::l2_norm::L2Norm::child_name(&self, _options: & pub fn vortex_tensor::scalar_fns::l2_norm::L2Norm::execute(&self, _options: &Self::Options, args: &dyn vortex_array::scalar_fn::vtable::ExecutionArgs, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_tensor::scalar_fns::l2_norm::L2Norm::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::expression::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - pub fn vortex_tensor::scalar_fns::l2_norm::L2Norm::id(&self) -> vortex_array::scalar_fn::ScalarFnId pub fn vortex_tensor::scalar_fns::l2_norm::L2Norm::is_fallible(&self, _options: &Self::Options) -> bool @@ -454,8 +446,6 @@ pub fn vortex_tensor::scalar_fns::sorf_transform::SorfTransform::child_name(&sel pub fn vortex_tensor::scalar_fns::sorf_transform::SorfTransform::execute(&self, options: &Self::Options, args: &dyn vortex_array::scalar_fn::vtable::ExecutionArgs, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_tensor::scalar_fns::sorf_transform::SorfTransform::fmt_sql(&self, _options: &Self::Options, expr: &vortex_array::expr::expression::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - pub fn vortex_tensor::scalar_fns::sorf_transform::SorfTransform::id(&self) -> vortex_array::scalar_fn::ScalarFnId pub fn vortex_tensor::scalar_fns::sorf_transform::SorfTransform::is_fallible(&self, _options: &Self::Options) -> bool diff --git a/vortex-tensor/src/scalar_fns/cosine_similarity.rs b/vortex-tensor/src/scalar_fns/cosine_similarity.rs index f4f129c2b27..45fc33989cc 100644 --- a/vortex-tensor/src/scalar_fns/cosine_similarity.rs +++ b/vortex-tensor/src/scalar_fns/cosine_similarity.rs @@ -3,8 +3,6 @@ //! Cosine similarity expression for tensor-like types. -use std::fmt::Formatter; - use num_traits::Zero; use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; @@ -92,19 +90,6 @@ impl ScalarFnVTable for CosineSimilarity { } } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> std::fmt::Result { - write!(f, "cosine_similarity(")?; - expr.child(0).fmt_sql(f)?; - write!(f, ", ")?; - expr.child(1).fmt_sql(f)?; - write!(f, ")") - } - fn return_dtype(&self, _options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult { let lhs = &arg_dtypes[0]; let rhs = &arg_dtypes[1]; diff --git a/vortex-tensor/src/scalar_fns/inner_product.rs b/vortex-tensor/src/scalar_fns/inner_product.rs index 71288c241ae..e1947a35f42 100644 --- a/vortex-tensor/src/scalar_fns/inner_product.rs +++ b/vortex-tensor/src/scalar_fns/inner_product.rs @@ -3,8 +3,6 @@ //! Inner product expression for tensor-like types. -use std::fmt::Formatter; - use num_traits::Float; use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; @@ -89,19 +87,6 @@ impl ScalarFnVTable for InnerProduct { } } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> std::fmt::Result { - write!(f, "inner_product(")?; - expr.child(0).fmt_sql(f)?; - write!(f, ", ")?; - expr.child(1).fmt_sql(f)?; - write!(f, ")") - } - fn return_dtype(&self, _options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult { let lhs = &arg_dtypes[0]; let rhs = &arg_dtypes[1]; diff --git a/vortex-tensor/src/scalar_fns/l2_denorm.rs b/vortex-tensor/src/scalar_fns/l2_denorm.rs index d72940c8da8..7004faee345 100644 --- a/vortex-tensor/src/scalar_fns/l2_denorm.rs +++ b/vortex-tensor/src/scalar_fns/l2_denorm.rs @@ -3,8 +3,6 @@ //! L2 denormalization expression for tensor-like types. -use std::fmt::Formatter; - use num_traits::ToPrimitive; use num_traits::Zero; use vortex_array::ArrayRef; @@ -144,19 +142,6 @@ impl ScalarFnVTable for L2Denorm { } } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> std::fmt::Result { - write!(f, "l2_denorm(")?; - expr.child(0).fmt_sql(f)?; - write!(f, ", ")?; - expr.child(1).fmt_sql(f)?; - write!(f, ")") - } - fn return_dtype(&self, _options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult { let normalized = &arg_dtypes[0]; let norms = &arg_dtypes[1]; diff --git a/vortex-tensor/src/scalar_fns/l2_norm.rs b/vortex-tensor/src/scalar_fns/l2_norm.rs index 170ac800d10..5d88ddd824d 100644 --- a/vortex-tensor/src/scalar_fns/l2_norm.rs +++ b/vortex-tensor/src/scalar_fns/l2_norm.rs @@ -3,8 +3,6 @@ //! L2 norm expression for tensor-like types. -use std::fmt::Formatter; - use num_traits::Float; use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; @@ -86,17 +84,6 @@ impl ScalarFnVTable for L2Norm { } } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> std::fmt::Result { - write!(f, "l2_norm(")?; - expr.child(0).fmt_sql(f)?; - write!(f, ")") - } - fn return_dtype(&self, _options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult { let input_dtype = &arg_dtypes[0]; let tensor_match = validate_tensor_float_input(input_dtype)?; diff --git a/vortex-tensor/src/scalar_fns/sorf_transform/vtable.rs b/vortex-tensor/src/scalar_fns/sorf_transform/vtable.rs index 69ae671bc85..6280d5bd0a0 100644 --- a/vortex-tensor/src/scalar_fns/sorf_transform/vtable.rs +++ b/vortex-tensor/src/scalar_fns/sorf_transform/vtable.rs @@ -3,8 +3,6 @@ //! [`ScalarFnVTable`] implementation for [`SorfTransform`]. -use std::fmt; -use std::fmt::Formatter; use std::sync::Arc; use num_traits::Float; @@ -62,17 +60,6 @@ impl ScalarFnVTable for SorfTransform { } } - fn fmt_sql( - &self, - _options: &Self::Options, - expr: &Expression, - f: &mut Formatter<'_>, - ) -> fmt::Result { - write!(f, "sorf_transform(")?; - expr.child(0).fmt_sql(f)?; - write!(f, ")") - } - fn return_dtype(&self, options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult { validate_sorf_options(options)?;