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

agrove pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git


The following commit(s) were added to refs/heads/main by this push:
     new 3f0d442cb chore: extract agg_funcs expressions to folders based on 
spark grouping (#1224)
3f0d442cb is described below

commit 3f0d442cb25f6842d231a03cb44e3807803555c4
Author: Raz Luvaton <[email protected]>
AuthorDate: Tue Jan 7 18:29:48 2025 +0200

    chore: extract agg_funcs expressions to folders based on spark grouping 
(#1224)
    
    * extract agg_funcs expressions to folders based on spark grouping
    
    * fix rebase
---
 native/spark-expr/src/{ => agg_funcs}/avg.rs       |  0
 .../spark-expr/src/{ => agg_funcs}/avg_decimal.rs  |  0
 .../spark-expr/src/{ => agg_funcs}/correlation.rs  |  4 +--
 .../spark-expr/src/{ => agg_funcs}/covariance.rs   |  0
 native/spark-expr/src/agg_funcs/mod.rs             | 32 ++++++++++++++++++++++
 native/spark-expr/src/{ => agg_funcs}/stddev.rs    |  2 +-
 .../spark-expr/src/{ => agg_funcs}/sum_decimal.rs  |  0
 native/spark-expr/src/{ => agg_funcs}/variance.rs  |  0
 native/spark-expr/src/lib.rs                       | 19 +++----------
 9 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/native/spark-expr/src/avg.rs 
b/native/spark-expr/src/agg_funcs/avg.rs
similarity index 100%
rename from native/spark-expr/src/avg.rs
rename to native/spark-expr/src/agg_funcs/avg.rs
diff --git a/native/spark-expr/src/avg_decimal.rs 
b/native/spark-expr/src/agg_funcs/avg_decimal.rs
similarity index 100%
rename from native/spark-expr/src/avg_decimal.rs
rename to native/spark-expr/src/agg_funcs/avg_decimal.rs
diff --git a/native/spark-expr/src/correlation.rs 
b/native/spark-expr/src/agg_funcs/correlation.rs
similarity index 98%
rename from native/spark-expr/src/correlation.rs
rename to native/spark-expr/src/agg_funcs/correlation.rs
index e4ddab95d..5d6f9e0b4 100644
--- a/native/spark-expr/src/correlation.rs
+++ b/native/spark-expr/src/agg_funcs/correlation.rs
@@ -19,8 +19,8 @@ use arrow::compute::{and, filter, is_not_null};
 
 use std::{any::Any, sync::Arc};
 
-use crate::covariance::CovarianceAccumulator;
-use crate::stddev::StddevAccumulator;
+use crate::agg_funcs::covariance::CovarianceAccumulator;
+use crate::agg_funcs::stddev::StddevAccumulator;
 use arrow::{
     array::ArrayRef,
     datatypes::{DataType, Field},
diff --git a/native/spark-expr/src/covariance.rs 
b/native/spark-expr/src/agg_funcs/covariance.rs
similarity index 100%
rename from native/spark-expr/src/covariance.rs
rename to native/spark-expr/src/agg_funcs/covariance.rs
diff --git a/native/spark-expr/src/agg_funcs/mod.rs 
b/native/spark-expr/src/agg_funcs/mod.rs
new file mode 100644
index 000000000..252da7889
--- /dev/null
+++ b/native/spark-expr/src/agg_funcs/mod.rs
@@ -0,0 +1,32 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+mod avg;
+mod avg_decimal;
+mod correlation;
+mod covariance;
+mod stddev;
+mod sum_decimal;
+mod variance;
+
+pub use avg::Avg;
+pub use avg_decimal::AvgDecimal;
+pub use correlation::Correlation;
+pub use covariance::Covariance;
+pub use stddev::Stddev;
+pub use sum_decimal::SumDecimal;
+pub use variance::Variance;
diff --git a/native/spark-expr/src/stddev.rs 
b/native/spark-expr/src/agg_funcs/stddev.rs
similarity index 99%
rename from native/spark-expr/src/stddev.rs
rename to native/spark-expr/src/agg_funcs/stddev.rs
index 1ec5ffb69..39dffa1c8 100644
--- a/native/spark-expr/src/stddev.rs
+++ b/native/spark-expr/src/agg_funcs/stddev.rs
@@ -17,7 +17,7 @@
 
 use std::{any::Any, sync::Arc};
 
-use crate::variance::VarianceAccumulator;
+use crate::agg_funcs::variance::VarianceAccumulator;
 use arrow::{
     array::ArrayRef,
     datatypes::{DataType, Field},
diff --git a/native/spark-expr/src/sum_decimal.rs 
b/native/spark-expr/src/agg_funcs/sum_decimal.rs
similarity index 100%
rename from native/spark-expr/src/sum_decimal.rs
rename to native/spark-expr/src/agg_funcs/sum_decimal.rs
diff --git a/native/spark-expr/src/variance.rs 
b/native/spark-expr/src/agg_funcs/variance.rs
similarity index 100%
rename from native/spark-expr/src/variance.rs
rename to native/spark-expr/src/agg_funcs/variance.rs
diff --git a/native/spark-expr/src/lib.rs b/native/spark-expr/src/lib.rs
index 9cf0de30b..3c2a70197 100644
--- a/native/spark-expr/src/lib.rs
+++ b/native/spark-expr/src/lib.rs
@@ -23,18 +23,10 @@ mod cast;
 mod error;
 mod if_expr;
 
-mod avg;
-pub use avg::Avg;
 mod bitwise_not;
 pub use bitwise_not::{bitwise_not, BitwiseNotExpr};
-mod avg_decimal;
-pub use avg_decimal::AvgDecimal;
 mod checkoverflow;
 pub use checkoverflow::CheckOverflow;
-mod correlation;
-pub use correlation::Correlation;
-mod covariance;
-pub use covariance::Covariance;
 mod strings;
 pub use strings::{Contains, EndsWith, Like, StartsWith, StringSpaceExpr, 
SubstringExpr};
 mod kernels;
@@ -46,13 +38,9 @@ mod static_invoke;
 pub use schema_adapter::SparkSchemaAdapterFactory;
 pub use static_invoke::*;
 
+mod negative;
 pub mod spark_hash;
-mod stddev;
-pub use stddev::Stddev;
 mod struct_funcs;
-mod sum_decimal;
-pub use sum_decimal::SumDecimal;
-mod negative;
 pub use negative::{create_negate_expr, NegativeExpr};
 mod normalize_nan;
 mod temporal;
@@ -65,9 +53,10 @@ pub use unbound::UnboundColumn;
 pub mod utils;
 pub use normalize_nan::NormalizeNaNAndZero;
 
-mod variance;
-pub use variance::Variance;
+mod agg_funcs;
 mod comet_scalar_funcs;
+pub use agg_funcs::*;
+
 pub use cast::{spark_cast, Cast, SparkCastOptions};
 pub use comet_scalar_funcs::create_comet_physical_fun;
 pub use error::{SparkError, SparkResult};


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to