Skip to content

Commit bcc63b6

Browse files
committed
extract agg_funcs expressions to folders based on spark grouping
1 parent 5f1e998 commit bcc63b6

File tree

9 files changed

+39
-18
lines changed

9 files changed

+39
-18
lines changed
File renamed without changes.

native/spark-expr/src/correlation.rs renamed to native/spark-expr/src/agg_funcs/correlation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use arrow::compute::{and, filter, is_not_null};
1919

2020
use std::{any::Any, sync::Arc};
2121

22-
use crate::covariance::CovarianceAccumulator;
23-
use crate::stddev::StddevAccumulator;
22+
use crate::agg_funcs::covariance::CovarianceAccumulator;
23+
use crate::agg_funcs::stddev::StddevAccumulator;
2424
use arrow::{
2525
array::ArrayRef,
2626
datatypes::{DataType, Field},
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
mod avg;
19+
mod avg_decimal;
20+
mod correlation;
21+
mod covariance;
22+
mod stddev;
23+
mod sum_decimal;
24+
mod variance;
25+
26+
pub use avg::Avg;
27+
pub use avg_decimal::AvgDecimal;
28+
pub use correlation::Correlation;
29+
pub use covariance::Covariance;
30+
pub use stddev::Stddev;
31+
pub use sum_decimal::SumDecimal;
32+
pub use variance::Variance;

native/spark-expr/src/stddev.rs renamed to native/spark-expr/src/agg_funcs/stddev.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use std::{any::Any, sync::Arc};
1919

20-
use crate::variance::VarianceAccumulator;
20+
use crate::agg_funcs::variance::VarianceAccumulator;
2121
use arrow::{
2222
array::ArrayRef,
2323
datatypes::{DataType, Field},
File renamed without changes.

native/spark-expr/src/lib.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,10 @@ mod cast;
2323
mod error;
2424
mod if_expr;
2525

26-
mod avg;
27-
pub use avg::Avg;
2826
mod bitwise_not;
2927
pub use bitwise_not::{bitwise_not, BitwiseNotExpr};
30-
mod avg_decimal;
31-
pub use avg_decimal::AvgDecimal;
3228
mod checkoverflow;
3329
pub use checkoverflow::CheckOverflow;
34-
mod correlation;
35-
pub use correlation::Correlation;
36-
mod covariance;
37-
pub use covariance::Covariance;
3830
mod strings;
3931
pub use strings::{Contains, EndsWith, Like, StartsWith, StringSpaceExpr, SubstringExpr};
4032
mod kernels;
@@ -44,13 +36,9 @@ pub mod scalar_funcs;
4436
mod schema_adapter;
4537
pub use schema_adapter::SparkSchemaAdapterFactory;
4638

39+
mod negative;
4740
pub mod spark_hash;
48-
mod stddev;
49-
pub use stddev::Stddev;
5041
mod structs;
51-
mod sum_decimal;
52-
pub use sum_decimal::SumDecimal;
53-
mod negative;
5442
pub use negative::{create_negate_expr, NegativeExpr};
5543
mod normalize_nan;
5644
mod temporal;
@@ -63,9 +51,10 @@ pub use unbound::UnboundColumn;
6351
pub mod utils;
6452
pub use normalize_nan::NormalizeNaNAndZero;
6553

66-
mod variance;
67-
pub use variance::Variance;
54+
mod agg_funcs;
6855
mod comet_scalar_funcs;
56+
pub use agg_funcs::*;
57+
6958
pub use cast::{spark_cast, Cast, SparkCastOptions};
7059
pub use comet_scalar_funcs::create_comet_physical_fun;
7160
pub use error::{SparkError, SparkResult};

0 commit comments

Comments
 (0)