1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-4809 The patch replaces legacy scanning/filtering code with a number of templates that

simplifies control flow removing needless expressions
This commit is contained in:
Roman Nozdrin
2021-07-27 06:44:23 +00:00
parent 7d7c982d9e
commit 67c85dae15
13 changed files with 2280 additions and 1431 deletions

View File

@ -113,9 +113,15 @@ protected:
void _loadData();
void updateCPDataNarrow();
void updateCPDataWide();
template<int W>
void _issuePrimitiveNarrow();
template<int W>
void _issuePrimitive();
virtual void issuePrimitive();
void duplicate(ColumnCommand*);
void fillInPrimitiveMessageHeader(const int8_t outputType, const bool absRids);
template<typename T>
void createColumnFilter();
// we only care about the width and type fields.
//On the PM the rest is uninitialized
@ -125,7 +131,6 @@ protected:
ColumnCommand& operator=(const ColumnCommand&);
void _execute();
void issuePrimitive();
void processResult();
template<int W>
void _process_OT_BOTH();
@ -202,6 +207,7 @@ class ColumnCommandInt8 : public ColumnCommand
{
public:
static constexpr uint8_t size = 1;
using IntegralType = datatypes::WidthToSIntegralType<size>::type;
ColumnCommandInt8() : ColumnCommand() { };
ColumnCommandInt8(execplan::CalpontSystemCatalog::ColType& colType, messageqcpp::ByteStream& bs);
void prep(int8_t outputType, bool absRids) override;
@ -209,12 +215,14 @@ class ColumnCommandInt8 : public ColumnCommand
void process_OT_BOTH() override;
void process_OT_DATAVALUE() override;
void projectResultRG(rowgroup::RowGroup& rg, uint32_t pos) override;
void issuePrimitive() override;
};
class ColumnCommandInt16 : public ColumnCommand
{
public:
static constexpr uint8_t size = 2;
using IntegralType = datatypes::WidthToSIntegralType<size>::type;
ColumnCommandInt16() : ColumnCommand() { };
ColumnCommandInt16(execplan::CalpontSystemCatalog::ColType& colType, messageqcpp::ByteStream& bs);
void prep(int8_t outputType, bool absRids) override;
@ -222,12 +230,14 @@ class ColumnCommandInt16 : public ColumnCommand
void process_OT_BOTH() override;
void process_OT_DATAVALUE() override;
void projectResultRG(rowgroup::RowGroup& rg, uint32_t pos) override;
void issuePrimitive() override;
};
class ColumnCommandInt32 : public ColumnCommand
{
public:
static constexpr uint8_t size = 4;
using IntegralType = datatypes::WidthToSIntegralType<size>::type;
ColumnCommandInt32() : ColumnCommand() { };
ColumnCommandInt32(execplan::CalpontSystemCatalog::ColType& colType, messageqcpp::ByteStream& bs);
void prep(int8_t outputType, bool absRids) override;
@ -235,12 +245,14 @@ class ColumnCommandInt32 : public ColumnCommand
void process_OT_BOTH() override;
void process_OT_DATAVALUE() override;
void projectResultRG(rowgroup::RowGroup& rg, uint32_t pos) override;
void issuePrimitive() override;
};
class ColumnCommandInt64 : public ColumnCommand
{
public:
static constexpr uint8_t size = 8;
using IntegralType = datatypes::WidthToSIntegralType<size>::type;
ColumnCommandInt64() : ColumnCommand() { };
ColumnCommandInt64(execplan::CalpontSystemCatalog::ColType& colType, messageqcpp::ByteStream& bs);
void prep(int8_t outputType, bool absRids) override;
@ -248,12 +260,14 @@ class ColumnCommandInt64 : public ColumnCommand
void process_OT_BOTH() override;
void process_OT_DATAVALUE() override;
void projectResultRG(rowgroup::RowGroup& rg, uint32_t pos) override;
void issuePrimitive() override;
};
class ColumnCommandInt128 : public ColumnCommand
{
public:
static constexpr uint8_t size = 16;
using IntegralType = datatypes::WidthToSIntegralType<size>::type;
ColumnCommandInt128() : ColumnCommand() { };
ColumnCommandInt128(execplan::CalpontSystemCatalog::ColType& colType, messageqcpp::ByteStream& bs);
void prep(int8_t outputType, bool absRids) override;
@ -261,6 +275,7 @@ class ColumnCommandInt128 : public ColumnCommand
void process_OT_BOTH() override;
void process_OT_DATAVALUE() override;
void projectResultRG(rowgroup::RowGroup& rg, uint32_t pos) override;
void issuePrimitive() override;
};