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-4580 extent elimination for dictionary-based text/varchar types
The idea is relatively simple - encode prefixes of collated strings as integers and use them to compute extents' ranges. Then we can eliminate extents with strings. The actual patch does have all the code there but miss one important step: we do not keep collation index, we keep charset index. Because of this, some of the tests in the bugfix suite fail and thus main functionality is turned off. The reason of this patch to be put into PR at all is that it contains changes that made CHAR/VARCHAR columns unsigned. This change is needed in vectorization work.
This commit is contained in:
@ -36,6 +36,7 @@
|
||||
#include "columnwidth.h"
|
||||
#include "mcs_decimal.h"
|
||||
#include "mcs_int64.h"
|
||||
#include "numericliteral.h"
|
||||
|
||||
namespace messageqcpp
|
||||
{
|
||||
@ -664,25 +665,19 @@ inline int64_t TreeNode::getIntVal()
|
||||
switch (fResultType.colDataType)
|
||||
{
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
if (fResultType.colWidth <= 8)
|
||||
return fResult.intVal;
|
||||
|
||||
return atoll(fResult.strVal.c_str());
|
||||
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
if (fResultType.colWidth <= 7)
|
||||
return fResult.intVal;
|
||||
|
||||
return atoll(fResult.strVal.c_str());
|
||||
|
||||
// FIXME: ???
|
||||
case CalpontSystemCatalog::VARBINARY:
|
||||
case CalpontSystemCatalog::BLOB:
|
||||
case CalpontSystemCatalog::TEXT:
|
||||
if (fResultType.colWidth <= 7)
|
||||
return fResult.intVal;
|
||||
|
||||
return atoll(fResult.strVal.c_str());
|
||||
{
|
||||
datatypes::DataCondition cnverr;
|
||||
literal::Converter<literal::SignedInteger> cnv(fResult.strVal, cnverr);
|
||||
if (datatypes::DataCondition::Code(cnverr) != 0)
|
||||
{
|
||||
cerr << "error in int conversion from '" << fResult.strVal << "'";
|
||||
}
|
||||
return cnv.toSInt<int64_t>(cnverr);
|
||||
}
|
||||
|
||||
case CalpontSystemCatalog::BIGINT:
|
||||
case CalpontSystemCatalog::TINYINT:
|
||||
@ -721,6 +716,20 @@ inline uint64_t TreeNode::getUintVal()
|
||||
{
|
||||
switch (fResultType.colDataType)
|
||||
{
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
case CalpontSystemCatalog::VARBINARY:
|
||||
case CalpontSystemCatalog::BLOB:
|
||||
case CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
datatypes::DataCondition cnverr;
|
||||
literal::Converter<literal::UnsignedInteger> cnv(fResult.strVal, cnverr);
|
||||
if (datatypes::DataCondition::Code(cnverr) != 0)
|
||||
{
|
||||
cerr << "error in unsigned int conversion from '" << fResult.strVal << "'";
|
||||
}
|
||||
return cnv.toXIntPositive<uint64_t>(cnverr);
|
||||
}
|
||||
case CalpontSystemCatalog::BIGINT:
|
||||
case CalpontSystemCatalog::TINYINT:
|
||||
case CalpontSystemCatalog::SMALLINT:
|
||||
|
Reference in New Issue
Block a user