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-4465 Use a proper ColType for UDAF in a projection RowGroup
This commit is contained in:
@ -463,6 +463,20 @@ bool isDuplicateSF(gp_walk_info *gwip, execplan::SimpleFilter *sfp)
|
|||||||
return false;
|
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 getViewName(TABLE_LIST* table_ptr)
|
||||||
{
|
{
|
||||||
string viewName = "";
|
string viewName = "";
|
||||||
@ -4979,10 +4993,28 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
|
|||||||
ct.precision = 0;
|
ct.precision = 0;
|
||||||
ac->resultType(ct);
|
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
|
else
|
||||||
{
|
{
|
||||||
// UDAF result type will be set below.
|
gwi.fatalParseError = true;
|
||||||
ac->resultType(parm->resultType());
|
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)
|
else if (bIsConst && hasDecimalConst && isAvg)
|
||||||
|
Reference in New Issue
Block a user