From 578fd9e60b4ad851dc358a71c951ca3e7a964266 Mon Sep 17 00:00:00 2001 From: Bharat Nallan Chakravarthy Date: Mon, 6 Jun 2022 15:00:37 +0530 Subject: [PATCH 001/158] implement quantileApproximateWeighted --- .../AggregateFunctionQuantile.cpp | 15 +- .../AggregateFunctionQuantile.h | 4 + .../QuantileApproximateWeighted.h | 256 ++++++++++++++++++ .../GatherFunctionQuantileVisitor.cpp | 2 + 4 files changed, 275 insertions(+), 2 deletions(-) create mode 100644 src/AggregateFunctions/QuantileApproximateWeighted.h diff --git a/src/AggregateFunctions/AggregateFunctionQuantile.cpp b/src/AggregateFunctions/AggregateFunctionQuantile.cpp index 6783a55418a..ebd6f44df17 100644 --- a/src/AggregateFunctions/AggregateFunctionQuantile.cpp +++ b/src/AggregateFunctions/AggregateFunctionQuantile.cpp @@ -41,6 +41,9 @@ template using FuncQuantilesExactInclusive = AggregateF template using FuncQuantileExactWeighted = AggregateFunctionQuantile, NameQuantileExactWeighted, true, void, false>; template using FuncQuantilesExactWeighted = AggregateFunctionQuantile, NameQuantilesExactWeighted, true, void, true>; +template using FuncQuantileApproximateWeighted = AggregateFunctionQuantile, NameQuantileApproximateWeighted, true, void, false>; +template using FuncQuantilesApproximateWeighted = AggregateFunctionQuantile, NameQuantilesApproximateWeighted, true, void, true>; + template using FuncQuantileTiming = AggregateFunctionQuantile, NameQuantileTiming, false, Float32, false>; template using FuncQuantilesTiming = AggregateFunctionQuantile, NameQuantilesTiming, false, Float32, true>; @@ -71,7 +74,9 @@ constexpr bool supportDecimal() std::is_same_v, FuncQuantilesExactLow> || std::is_same_v, FuncQuantilesExactHigh> || std::is_same_v, FuncQuantileExactWeighted> || - std::is_same_v, FuncQuantilesExactWeighted>; + std::is_same_v, FuncQuantilesExactWeighted> || + std::is_same_v, FuncQuantileApproximateWeighted> || + std::is_same_v, FuncQuantilesApproximateWeighted>; } template