You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ho...@apache.org on 2021/12/08 06:45:59 UTC

[arrow-datafusion] branch master updated: Minor test cleanup (#1416)

This is an automated email from the ASF dual-hosted git repository.

houqp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 6450a8d  Minor test cleanup (#1416)
6450a8d is described below

commit 6450a8df3d537c827804ee7e80c985cb68a67ee5
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Wed Dec 8 01:44:52 2021 -0500

    Minor test cleanup (#1416)
---
 datafusion/src/physical_plan/aggregates.rs | 32 ++++++++++--------------------
 1 file changed, 11 insertions(+), 21 deletions(-)

diff --git a/datafusion/src/physical_plan/aggregates.rs b/datafusion/src/physical_plan/aggregates.rs
index 3f9766f..50e1a82 100644
--- a/datafusion/src/physical_plan/aggregates.rs
+++ b/datafusion/src/physical_plan/aggregates.rs
@@ -417,29 +417,19 @@ mod tests {
                     AggregateFunction::Sum => {
                         assert!(result_agg_phy_exprs.as_any().is::<Sum>());
                         assert_eq!("c1", result_agg_phy_exprs.name());
-                        let mut expect_type = data_type.clone();
-                        if matches!(
-                            data_type,
+                        let expect_type = match data_type {
                             DataType::UInt8
-                                | DataType::UInt16
-                                | DataType::UInt32
-                                | DataType::UInt64
-                        ) {
-                            expect_type = DataType::UInt64;
-                        } else if matches!(
-                            data_type,
+                            | DataType::UInt16
+                            | DataType::UInt32
+                            | DataType::UInt64 => DataType::UInt64,
                             DataType::Int8
-                                | DataType::Int16
-                                | DataType::Int32
-                                | DataType::Int64
-                        ) {
-                            expect_type = DataType::Int64;
-                        } else if matches!(
-                            data_type,
-                            DataType::Float32 | DataType::Float64
-                        ) {
-                            expect_type = data_type.clone();
-                        }
+                            | DataType::Int16
+                            | DataType::Int32
+                            | DataType::Int64 => DataType::Int64,
+                            DataType::Float32 | DataType::Float64 => data_type.clone(),
+                            _ => data_type.clone(),
+                        };
+
                         assert_eq!(
                             Field::new("c1", expect_type.clone(), true),
                             result_agg_phy_exprs.field().unwrap()