Skip to content

Commit

Permalink
extract agg_funcs expressions to folders based on spark grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
rluvaton committed Jan 5, 2025
1 parent 5f1e998 commit bcc63b6
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 18 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
File renamed without changes.
32 changes: 32 additions & 0 deletions native/spark-expr/src/agg_funcs/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
File renamed without changes.
File renamed without changes.
19 changes: 4 additions & 15 deletions native/spark-expr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -44,13 +36,9 @@ pub mod scalar_funcs;
mod schema_adapter;
pub use schema_adapter::SparkSchemaAdapterFactory;

mod negative;
pub mod spark_hash;
mod stddev;
pub use stddev::Stddev;
mod structs;
mod sum_decimal;
pub use sum_decimal::SumDecimal;
mod negative;
pub use negative::{create_negate_expr, NegativeExpr};
mod normalize_nan;
mod temporal;
Expand All @@ -63,9 +51,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};
Expand Down

0 comments on commit bcc63b6

Please sign in to comment.