1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

feat(MCOL-5886): support InnoDB's table partitions in cross-engine joins

The purpose of this changeset is to obtain list of partitions from
SELECT_LEX structure and pass it down to joblist and then to
CrossEngineStep to pass to InnoDB.
This commit is contained in:
Serguey Zefirov
2025-01-20 06:46:45 +03:00
committed by Sergey Zefirov
parent b731c0a326
commit bd1622f331
23 changed files with 382 additions and 77 deletions

View File

@ -340,8 +340,15 @@ bool CalpontSystemCatalog::TableAliasName::operator<(const TableAliasName& rhs)
}
else if (view == rhs.view)
{
if (fisColumnStore < rhs.fisColumnStore)
if (partitions < rhs.partitions)
{
return true;
}
if (partitions == rhs.partitions)
{
if (fisColumnStore < rhs.fisColumnStore)
return true;
}
}
}
}
@ -357,6 +364,7 @@ void CalpontSystemCatalog::TableAliasName::serialize(messageqcpp::ByteStream& b)
b << alias;
b << view;
b << static_cast<ByteStream::doublebyte>(fisColumnStore);
partitions.serialize(b);
}
void CalpontSystemCatalog::TableAliasName::unserialize(messageqcpp::ByteStream& b)
@ -366,6 +374,7 @@ void CalpontSystemCatalog::TableAliasName::unserialize(messageqcpp::ByteStream&
b >> alias;
b >> view;
b >> reinterpret_cast<ByteStream::doublebyte&>(fisColumnStore);
partitions.unserialize(b);
}
/*static*/
@ -6319,5 +6328,47 @@ bool ctListSort(const CalpontSystemCatalog::ColType& a, const CalpontSystemCatal
return a.colPosition < b.colPosition;
}
bool operator <(const Partitions& a, const Partitions& b)
{
// lexicographic order.
uint32_t l = std::min(a.fPartNames.size(), b.fPartNames.size());
for (uint32_t i = 0; i < l; i++)
{
if (a.fPartNames[i] < b.fPartNames[i])
{
return true;
}
if (a.fPartNames[i] > b.fPartNames[i])
{
return false;
}
}
if (l < a.fPartNames.size())
{
return false;
}
if (l < b.fPartNames.size())
{
return true;
}
return false;
}
bool operator ==(const Partitions& a, const Partitions& b)
{
if (a.fPartNames.size() != b.fPartNames.size())
{
return false;
}
uint32_t l = a.fPartNames.size();
for (uint32_t i = 0; i < l; i++)
{
if (a.fPartNames[i] != b.fPartNames[i])
{
return false;
}
}
return true;
}
} // namespace execplan
// vim:sw=4 ts=4: