From e88becca303eb903f22f3bec44d864287cc85fb1 Mon Sep 17 00:00:00 2001 From: Gagan Goel Date: Tue, 10 Dec 2019 07:26:25 +0000 Subject: [PATCH] MCOL-3659 Use Long Double as result type for AVG_DISTINCT window function. --- dbcon/execplan/windowfunctioncolumn.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbcon/execplan/windowfunctioncolumn.cpp b/dbcon/execplan/windowfunctioncolumn.cpp index 2316cb510..b4ebd8b42 100644 --- a/dbcon/execplan/windowfunctioncolumn.cpp +++ b/dbcon/execplan/windowfunctioncolumn.cpp @@ -384,7 +384,8 @@ void WindowFunctionColumn::adjustResultType() fResultType = fFunctionParms[0]->resultType(); if (boost::iequals(fFunctionName, "SUM") || - boost::iequals(fFunctionName, "AVG")) + boost::iequals(fFunctionName, "AVG") || + boost::iequals(fFunctionName, "AVG_DISTINCT")) { fResultType.colDataType = CalpontSystemCatalog::LONGDOUBLE; fResultType.colWidth = sizeof(long double);