You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-1983 Have regr_intercept, regr_slope and regr_r2 return NULL for 1 or 0 rows in set
This commit is contained in:
@ -139,7 +139,7 @@ mcsv1_UDAF::ReturnCode regr_intercept::evaluate(mcsv1Context* context, static_an
|
||||
{
|
||||
struct regr_intercept_data* data = (struct regr_intercept_data*)context->getUserData()->data;
|
||||
double N = data->cnt;
|
||||
if (N > 0)
|
||||
if (N > 1)
|
||||
{
|
||||
double sumx = data->sumx;
|
||||
double sumy = data->sumy;
|
||||
|
@ -144,7 +144,7 @@ mcsv1_UDAF::ReturnCode regr_r2::evaluate(mcsv1Context* context, static_any::any&
|
||||
{
|
||||
struct regr_r2_data* data = (struct regr_r2_data*)context->getUserData()->data;
|
||||
double N = data->cnt;
|
||||
if (N > 0)
|
||||
if (N > 1)
|
||||
{
|
||||
double sumx = data->sumx;
|
||||
double sumy = data->sumy;
|
||||
|
@ -139,7 +139,7 @@ mcsv1_UDAF::ReturnCode regr_slope::evaluate(mcsv1Context* context, static_any::a
|
||||
{
|
||||
struct regr_slope_data* data = (struct regr_slope_data*)context->getUserData()->data;
|
||||
double N = data->cnt;
|
||||
if (N > 0)
|
||||
if (N > 1)
|
||||
{
|
||||
// COVAR_POP(y, x) / VAR_POP(x)
|
||||
double sumx = data->sumx;
|
||||
|
@ -84,7 +84,6 @@ void WF_udaf::resetData()
|
||||
getContext().getFunction()->reset(&getContext());
|
||||
fDistinctMap.clear();
|
||||
WindowFunctionType::resetData();
|
||||
fValOut.reset();
|
||||
}
|
||||
|
||||
void WF_udaf::parseParms(const std::vector<execplan::SRCP>& parms)
|
||||
@ -709,6 +708,7 @@ void WF_udaf::operator()(int64_t b, int64_t e, int64_t c)
|
||||
mcsv1sdk::mcsv1_UDAF::ReturnCode rc;
|
||||
uint64_t colOut = fFieldIndex[0];
|
||||
bool isNull = false;
|
||||
fValOut.reset();
|
||||
|
||||
if ((fFrameUnit == WF__FRAME_ROWS) ||
|
||||
(fPrev == -1) ||
|
||||
|
Reference in New Issue
Block a user