From f51326baa73ede9818a48476e6a805894ee53448 Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Wed, 5 Jun 2024 23:42:09 -0700 Subject: [PATCH] Fix --- .../execution/datafusion/expressions/negative.rs | 14 +++++++------- .../execution/datafusion/expressions/unbound.rs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/src/execution/datafusion/expressions/negative.rs b/core/src/execution/datafusion/expressions/negative.rs index e7aa2ac64..b369eb717 100644 --- a/core/src/execution/datafusion/expressions/negative.rs +++ b/core/src/execution/datafusion/expressions/negative.rs @@ -24,9 +24,8 @@ use datafusion::{ physical_expr::PhysicalExpr, }; use datafusion_common::{Result, ScalarValue}; -use datafusion_physical_expr::{ - aggregate::utils::down_cast_any_ref, sort_properties::SortProperties, -}; +use datafusion_expr::sort_properties::ExprProperties; +use datafusion_physical_expr::aggregate::utils::down_cast_any_ref; use std::{ any::Any, hash::{Hash, Hasher}, @@ -195,8 +194,8 @@ impl PhysicalExpr for NegativeExpr { } } - fn children(&self) -> Vec> { - vec![self.arg.clone()] + fn children(&self) -> Vec<&Arc> { + vec![&self.arg] } fn with_new_children( @@ -255,8 +254,9 @@ impl PhysicalExpr for NegativeExpr { } /// The ordering of a [`NegativeExpr`] is simply the reverse of its child. - fn get_ordering(&self, children: &[SortProperties]) -> SortProperties { - -children[0] + fn get_properties(&self, children: &[ExprProperties]) -> Result { + let properties = children[0].clone().with_order(children[0].sort_properties); + Ok(properties) } } diff --git a/core/src/execution/datafusion/expressions/unbound.rs b/core/src/execution/datafusion/expressions/unbound.rs index 5387b1012..95f9912c9 100644 --- a/core/src/execution/datafusion/expressions/unbound.rs +++ b/core/src/execution/datafusion/expressions/unbound.rs @@ -83,7 +83,7 @@ impl PhysicalExpr for UnboundColumn { internal_err!("UnboundColumn::evaluate() should not be called") } - fn children(&self) -> Vec> { + fn children(&self) -> Vec<&Arc> { vec![] }