From 2255d41eaf057d5e91be26c3c483aa813f74d35f Mon Sep 17 00:00:00 2001 From: David Hall Date: Thu, 20 Jun 2019 15:54:05 -0500 Subject: [PATCH] MCOL-3343 Error when no group by for unaggregated fields in window functions. --- dbcon/joblist/windowfunctionstep.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dbcon/joblist/windowfunctionstep.cpp b/dbcon/joblist/windowfunctionstep.cpp index 172a7a8a5..1a603a98e 100644 --- a/dbcon/joblist/windowfunctionstep.cpp +++ b/dbcon/joblist/windowfunctionstep.cpp @@ -346,7 +346,10 @@ void WindowFunctionStep::AddSimplColumn(const vector& scs, if (scProjected.find(UniqId(*i)) == scProjected.end()) { jobInfo.windowDels.push_back(SRCP((*i)->clone())); - jobInfo.windowSet.insert(getTupleKey(jobInfo, *i, true)); +// MCOL-3343 Enable this if we decide to allow Window Functions to run with +// aggregates with no group by. MariaDB allows this. Nobody else in the world does. +// There will be more work to get it to function if we try this. +// jobInfo.windowSet.insert(getTupleKey(jobInfo, *i, true)); scProjected.insert(UniqId(*i)); } } @@ -496,7 +499,10 @@ void WindowFunctionStep::checkWindowFunction(CalpontSelectExecutionPlan* csep, J if (colSet.find(key) == colSet.end()) { jobInfo.deliveredCols.push_back(*j); - jobInfo.windowSet.insert(getTupleKey(jobInfo, *j, true)); +// MCOL-3343 Enable this if we decide to allow Window Functions to run with +// aggregates with no group by. MariaDB allows this. Nobody else in the world does. +// There will be more work to get it to function if we try this. +// jobInfo.windowSet.insert(getTupleKey(jobInfo, *j, true)); } colSet.insert(key);