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
Merge pull request #1691 from drrtuy/MCOL-4465_MCOL-4466_MCOL-4452
Mcol 4465 mcol 4466 mcol 4452
This commit is contained in:
@ -463,6 +463,20 @@ bool isDuplicateSF(gp_walk_info *gwip, execplan::SimpleFilter *sfp)
|
||||
return false;
|
||||
}
|
||||
|
||||
// DESCRIPTION:
|
||||
// This f() checks if the arguments is a UDF Item
|
||||
// PARAMETERS:
|
||||
// Item * Item to traverse
|
||||
// RETURN:
|
||||
// bool
|
||||
inline bool isUDFSumItem(const Item_sum* isp)
|
||||
{
|
||||
return typeid(*isp) == typeid(Item_sum_udf_int) ||
|
||||
typeid(*isp) == typeid(Item_sum_udf_float) ||
|
||||
typeid(*isp) == typeid(Item_sum_udf_decimal) ||
|
||||
typeid(*isp) == typeid(Item_sum_udf_str);
|
||||
}
|
||||
|
||||
string getViewName(TABLE_LIST* table_ptr)
|
||||
{
|
||||
string viewName = "";
|
||||
@ -4987,10 +5001,28 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
|
||||
ct.precision = 0;
|
||||
ac->resultType(ct);
|
||||
}
|
||||
// Setting the ColType in the resulting RowGroup
|
||||
// according with what MDB expects.
|
||||
// Internal processing UDAF result type will be set below.
|
||||
else if (isUDFSumItem(isp))
|
||||
{
|
||||
ac->resultType(colType_MysqlToIDB(isp));
|
||||
}
|
||||
// Using the first param to deduce ac data type
|
||||
else if (ac->aggParms().size() == 1)
|
||||
{
|
||||
ac->resultType(parm->resultType());
|
||||
}
|
||||
else
|
||||
{
|
||||
// UDAF result type will be set below.
|
||||
ac->resultType(parm->resultType());
|
||||
gwi.fatalParseError = true;
|
||||
gwi.parseErrorText = "Can not deduce Aggregate Column resulting type \
|
||||
because it has multiple arguments.";
|
||||
|
||||
if (ac)
|
||||
delete ac;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
else if (bIsConst && hasDecimalConst && isAvg)
|
||||
|
@ -38,7 +38,7 @@ static Add_regr_count_ToUDAFMap addToMap;
|
||||
// Use the simple data model
|
||||
struct regr_count_data
|
||||
{
|
||||
uint64_t cnt;
|
||||
long long cnt;
|
||||
};
|
||||
|
||||
|
||||
|
@ -4627,13 +4627,14 @@ void RowAggregationUMP2::doUDAF(const Row& rowIn,
|
||||
// Call the UDAF subEvaluate method
|
||||
mcsv1sdk::mcsv1_UDAF::ReturnCode rc;
|
||||
rc = udafContextsColl[funcColsIdx].getFunction()->subEvaluate(&udafContextsColl[funcColsIdx], userDataIn.get());
|
||||
fRGContext.setUserData(NULL);
|
||||
udafContextsColl[funcColsIdx].setUserData(NULL);
|
||||
|
||||
if (rc == mcsv1sdk::mcsv1_UDAF::ERROR)
|
||||
{
|
||||
RowUDAFFunctionCol* rowUDAF = dynamic_cast<RowUDAFFunctionCol*>(fFunctionCols[funcColsIdx].get());
|
||||
rowUDAF->bInterrupted = true;
|
||||
throw logging::IDBExcept(fRGContext.getErrorMessage(), logging::aggregateFuncErr);
|
||||
throw logging::IDBExcept(udafContextsColl[funcColsIdx].getErrorMessage(),
|
||||
logging::aggregateFuncErr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ using namespace mcsv1sdk;
|
||||
|
||||
struct distinct_count_data
|
||||
{
|
||||
uint64_t cnt;
|
||||
long long cnt;
|
||||
};
|
||||
|
||||
#define OUT_TYPE int64_t
|
||||
@ -34,7 +34,7 @@ mcsv1_UDAF::ReturnCode distinct_count::init(mcsv1Context* context,
|
||||
{
|
||||
// The error message will be prepended with
|
||||
// "The storage engine for the table doesn't support "
|
||||
context->setErrorMessage("avgx() with other than 1 arguments");
|
||||
context->setErrorMessage("distinct_count() with other than 1 arguments");
|
||||
return mcsv1_UDAF::ERROR;
|
||||
}
|
||||
context->setResultType(execplan::CalpontSystemCatalog::BIGINT);
|
||||
|
Reference in New Issue
Block a user