diff --git a/velox/functions/sparksql/aggregates/CentralMomentsAggregate.cpp b/velox/functions/sparksql/aggregates/CentralMomentsAggregate.cpp index 39747bd3fc45..1a8d3a34a2c1 100644 --- a/velox/functions/sparksql/aggregates/CentralMomentsAggregate.cpp +++ b/velox/functions/sparksql/aggregates/CentralMomentsAggregate.cpp @@ -34,7 +34,8 @@ struct SkewnessResultAccessor { template exec::AggregateRegistrationResult registerCentralMoments( const std::string& name, - bool withCompanionFunctions) { + bool withCompanionFunctions, + bool overwrite) { std::vector> signatures; std::vector inputTypes = { "smallint", "integer", "bigint", "real", "double"}; @@ -97,15 +98,17 @@ exec::AggregateRegistrationResult registerCentralMoments( TResultAccessor>>(resultType); } }, - withCompanionFunctions); + withCompanionFunctions, + overwrite); } } // namespace void registerCentralMomentsAggregate( const std::string& prefix, - bool withCompanionFunctions) { + bool withCompanionFunctions, + bool overwrite) { registerCentralMoments( - prefix + "skewness", withCompanionFunctions); + prefix + "skewness", withCompanionFunctions, overwrite); } } // namespace facebook::velox::functions::aggregate::sparksql diff --git a/velox/functions/sparksql/aggregates/CentralMomentsAggregate.h b/velox/functions/sparksql/aggregates/CentralMomentsAggregate.h index 48068c679604..a0b9a69297e3 100644 --- a/velox/functions/sparksql/aggregates/CentralMomentsAggregate.h +++ b/velox/functions/sparksql/aggregates/CentralMomentsAggregate.h @@ -24,6 +24,7 @@ namespace facebook::velox::functions::aggregate::sparksql { void registerCentralMomentsAggregate( const std::string& name, - bool withCompanionFunctions); + bool withCompanionFunctions, + bool overwrite); } // namespace facebook::velox::functions::aggregate::sparksql diff --git a/velox/functions/sparksql/aggregates/Register.cpp b/velox/functions/sparksql/aggregates/Register.cpp index 901fc1f48fbc..7a2886dff2de 100644 --- a/velox/functions/sparksql/aggregates/Register.cpp +++ b/velox/functions/sparksql/aggregates/Register.cpp @@ -44,6 +44,6 @@ void registerAggregateFunctions( prefix + "bloom_filter_agg", withCompanionFunctions, overwrite); registerAverage(prefix + "avg", withCompanionFunctions, overwrite); registerSum(prefix + "sum", withCompanionFunctions, overwrite); - registerCentralMomentsAggregate(prefix, withCompanionFunctions); + registerCentralMomentsAggregate(prefix, withCompanionFunctions, overwrite); } } // namespace facebook::velox::functions::aggregate::sparksql