//===----------------------------------------------------------------------===// // DuckDB // // duckdb/core_functions/aggregate/regression/regr_count.hpp // // //===----------------------------------------------------------------------===// #pragma once #include "duckdb/function/aggregate_function.hpp" #include "duckdb/core_functions/aggregate/algebraic/covar.hpp" #include "duckdb/core_functions/aggregate/algebraic/stddev.hpp" namespace duckdb { struct RegrCountFunction { template static void Initialize(STATE &state) { state = 0; } template static void Combine(const STATE &source, STATE &target, AggregateInputData &) { target += source; } template static void Finalize(STATE &state, T &target, AggregateFinalizeData &finalize_data) { target = state; } static bool IgnoreNull() { return true; } template static void Operation(STATE &state, const A_TYPE &, const B_TYPE &, AggregateBinaryInput &) { state += 1; } }; } // namespace duckdb