diff --git a/datafusion/core/src/physical_plan/metrics/mod.rs b/datafusion/core/src/physical_plan/metrics/mod.rs index ca32cc96073e..ebaec48e7b91 100644 --- a/datafusion/core/src/physical_plan/metrics/mod.rs +++ b/datafusion/core/src/physical_plan/metrics/mod.rs @@ -161,8 +161,8 @@ impl Metric { } /// return a reference to the partition - pub fn partition(&self) -> &Option { - &self.partition + pub fn partition(&self) -> Option { + self.partition } } diff --git a/datafusion/physical-expr/src/aggregate/stats.rs b/datafusion/physical-expr/src/aggregate/stats.rs index 3f2d266622de..98baaccffe81 100644 --- a/datafusion/physical-expr/src/aggregate/stats.rs +++ b/datafusion/physical-expr/src/aggregate/stats.rs @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -/// Enum used for differenciating population and sample for statistical functions +/// Enum used for differentiating population and sample for statistical functions #[derive(Debug, Clone, Copy)] pub enum StatsType { /// Population diff --git a/datafusion/physical-expr/src/expressions/case.rs b/datafusion/physical-expr/src/expressions/case.rs index c4150e6cb0d7..3dff4ae9745a 100644 --- a/datafusion/physical-expr/src/expressions/case.rs +++ b/datafusion/physical-expr/src/expressions/case.rs @@ -97,8 +97,8 @@ impl CaseExpr { } /// Optional base expression that can be compared to literal values in the "when" expressions - pub fn expr(&self) -> &Option> { - &self.expr + pub fn expr(&self) -> Option<&Arc> { + self.expr.as_ref() } /// One or more when/then expressions diff --git a/datafusion/physical-expr/src/window/lead_lag.rs b/datafusion/physical-expr/src/window/lead_lag.rs index fc815a220af0..794c7bd39249 100644 --- a/datafusion/physical-expr/src/window/lead_lag.rs +++ b/datafusion/physical-expr/src/window/lead_lag.rs @@ -224,7 +224,7 @@ impl PartitionEvaluator for WindowShiftEvaluator { let dtype = array.data_type(); let idx = self.state.idx as i64 - self.shift_offset; if idx < 0 || idx as usize >= array.len() { - get_default_value(&self.default_value, dtype) + get_default_value(self.default_value.as_ref(), dtype) } else { ScalarValue::try_from_array(array, idx as usize) } @@ -238,7 +238,7 @@ impl PartitionEvaluator for WindowShiftEvaluator { } fn get_default_value( - default_value: &Option, + default_value: Option<&ScalarValue>, dtype: &DataType, ) -> Result { if let Some(value) = default_value { diff --git a/datafusion/proto/src/physical_plan/to_proto.rs b/datafusion/proto/src/physical_plan/to_proto.rs index 653baec9923d..a987e7fee097 100644 --- a/datafusion/proto/src/physical_plan/to_proto.rs +++ b/datafusion/proto/src/physical_plan/to_proto.rs @@ -187,7 +187,6 @@ impl TryFrom> for protobuf::PhysicalExprNode { protobuf::PhysicalCaseNode { expr: expr .expr() - .as_ref() .map(|exp| exp.clone().try_into().map(Box::new)) .transpose()?, when_then_expr: expr