You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-1793 Add udafContext to the copy constructor of WindowFunctionColumn.
This commit is contained in:
@ -233,7 +233,8 @@ WindowFunctionColumn::WindowFunctionColumn( const WindowFunctionColumn& rhs, con
|
||||
fFunctionName(rhs.functionName()),
|
||||
fFunctionParms(rhs.functionParms()),
|
||||
fPartitions (rhs.partitions()),
|
||||
fOrderBy (rhs.orderBy())
|
||||
fOrderBy (rhs.orderBy()),
|
||||
udafContext(rhs.getUDAFContext())
|
||||
{}
|
||||
|
||||
const string WindowFunctionColumn::toString() const
|
||||
|
@ -140,6 +140,10 @@ public:
|
||||
{
|
||||
return udafContext;
|
||||
}
|
||||
const mcsv1sdk::mcsv1Context& getUDAFContext() const
|
||||
{
|
||||
return udafContext;
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
|
@ -4,12 +4,9 @@
|
||||
<Project File="tools/configMgt/autoConfigure.vpj"/>
|
||||
<Project File="utils/batchloader/batchloader.vpj"/>
|
||||
<Project File="primitives/blockcache/blockcache.vpj"/>
|
||||
<Project File="utils/boost_idb/boost_idb.vpj"/>
|
||||
<Project File="versioning/BRM/brm.vpj"/>
|
||||
<Project File="writeengine/bulk/bulk.vpj"/>
|
||||
<Project File="utils/cacheutils/cacheutils.vpj"/>
|
||||
<Project File="oamapps/calpont-console/calpontConsole.vpj"/>
|
||||
<Project File="oamapps/calpontDB/calpontDBWrite.vpj"/>
|
||||
<Project File="tools/dbloadxml/colxml.vpj"/>
|
||||
<Project File="utils/common/common.vpj"/>
|
||||
<Project File="utils/compress/compress.vpj"/>
|
||||
|
@ -145,13 +145,12 @@ mcsv1_UDAF::ReturnCode regr_intercept::evaluate(mcsv1Context* context, static_an
|
||||
double sumy = data->sumy;
|
||||
double sumx2 = data->sumx2;
|
||||
double sumxy = data->sumxy;
|
||||
double slope = 0;
|
||||
double variance = (N * sumx2) - (sumx * sumx);
|
||||
if (variance != 0)
|
||||
double numerator = sumy * sumx2 - sumx * sumxy;
|
||||
double var_pop = (N * sumx2) - (sumx * sumx);
|
||||
if (var_pop != 0)
|
||||
{
|
||||
slope = ((N * sumxy) - (sumx * sumy)) / variance;
|
||||
valOut = numerator / var_pop;
|
||||
}
|
||||
valOut = (sumy - (slope * sumx)) / N;
|
||||
}
|
||||
return mcsv1_UDAF::SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user