From c6b1da40ba563d49c3ff9bc1f27cbeaaf952c397 Mon Sep 17 00:00:00 2001 From: wyxxxcat <1520358997@qq.com> Date: Sat, 10 Aug 2024 13:41:06 +0800 Subject: [PATCH 1/2] draft --- .../aggregate_function_regr_sxx.cpp | 74 +++++ .../aggregate_function_regr_sxx_.h | 270 ++++++++++++++++++ .../aggregate_function_simple_factory.cpp | 2 + .../doris/catalog/AggregateFunction.java | 1 + .../catalog/BuiltinAggregateFunctions.java | 8 +- .../org/apache/doris/catalog/FunctionSet.java | 33 +++ .../expressions/functions/agg/RegrSxx.java | 103 +++++++ .../expressions/functions/agg/RegrSxy.java | 103 +++++++ .../expressions/functions/agg/RegrSyy.java | 103 +++++++ .../visitor/AggregateFunctionVisitor.java | 15 + .../agg_function/test_regr_sxx.out | 22 ++ .../agg_function/test_regr_sxy.out | 25 ++ .../agg_function/test_regr_syy.out | 22 ++ .../agg_function/test_regr_sxx.groovy | 139 +++++++++ .../agg_function/test_regr_sxy.groovy | 132 +++++++++ .../agg_function/test_regr_syy.groovy | 128 +++++++++ 16 files changed, 1179 insertions(+), 1 deletion(-) create mode 100644 be/src/vec/aggregate_functions/aggregate_function_regr_sxx.cpp create mode 100644 be/src/vec/aggregate_functions/aggregate_function_regr_sxx_.h create mode 100644 fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/RegrSxx.java create mode 100644 fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/RegrSxy.java create mode 100644 fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/RegrSyy.java create mode 100644 regression-test/data/nereids_function_p0/agg_function/test_regr_sxx.out create mode 100644 regression-test/data/nereids_function_p0/agg_function/test_regr_sxy.out create mode 100644 regression-test/data/nereids_function_p0/agg_function/test_regr_syy.out create mode 100644 regression-test/suites/nereids_function_p0/agg_function/test_regr_sxx.groovy create mode 100644 regression-test/suites/nereids_function_p0/agg_function/test_regr_sxy.groovy create mode 100644 regression-test/suites/nereids_function_p0/agg_function/test_regr_syy.groovy diff --git a/be/src/vec/aggregate_functions/aggregate_function_regr_sxx.cpp b/be/src/vec/aggregate_functions/aggregate_function_regr_sxx.cpp new file mode 100644 index 00000000000000..8d9abd2721e0ca --- /dev/null +++ b/be/src/vec/aggregate_functions/aggregate_function_regr_sxx.cpp @@ -0,0 +1,74 @@ +// 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. + +#include + +#include + +#include "common/logging.h" +#include "vec/aggregate_functions/aggregate_function_regr_sxx_.h" +#include "vec/aggregate_functions/aggregate_function_simple_factory.h" +#include "vec/aggregate_functions/helpers.h" +#include "vec/data_types/data_type.h" +#include "vec/data_types/data_type_nullable.h" + +namespace doris::vectorized { +template