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

Merge pull request #1990 from drrtuy/MCOL-4173_9

MCOL-4173 This patch adds support for wide-DECIMAL INNER, OUTER, SEMI…
This commit is contained in:
Roman Nozdrin
2021-06-24 16:15:07 +03:00
committed by GitHub
22 changed files with 2347 additions and 228 deletions

View File

@ -1093,6 +1093,7 @@ void BatchPrimitiveProcessorJL::createBPP(ByteStream& bs) const
cout << "PMJoinerCount = " << PMJoinerCount << endl;
#endif
bool smallSideRGSent = false;
for (i = 0; i < PMJoinerCount; i++)
{
bs << (uint32_t) tJoiners[i]->size();
@ -1121,6 +1122,17 @@ void BatchPrimitiveProcessorJL::createBPP(ByteStream& bs) const
{
serializeVector<uint32_t>(bs, tJoiners[i]->getLargeKeyColumns());
bs << (uint32_t) tJoiners[i]->getKeyLength();
// MCOL-4173 Notify PP if smallSide and largeSide have different column widths
// and send smallSide RG to PP.
bool joinHasSkewedKeyColumn = tJoiners[i]->joinHasSkewedKeyColumn();
bs << joinHasSkewedKeyColumn;
if (!smallSideRGSent && joinHasSkewedKeyColumn)
{
idbassert(!smallSideRGs.empty());
bs << smallSideRGs[0];
serializeVector<uint32_t>(bs, tJoiners[i]->getSmallKeyColumns());
smallSideRGSent = true;
}
}
}
@ -1606,17 +1618,6 @@ bool BatchPrimitiveProcessorJL::nextTupleJoinerMsg(ByteStream& bs)
smallSide.setRowCount(toSend);
tmpData.serialize(bs, smallSide.getDataSize());
/*
uint32_t lpos;
uint8_t *buf;
bs.needAtLeast(r.getSize() * toSend);
buf = (uint8_t *) bs.getInputPtr();
//for (i = pos, lpos = 0; i < pos + toSend; i++, lpos += r.getSize())
// memcpy(&buf[lpos], (*tSmallSide)[i], r.getSize());
bs.advanceInputPtr(r.getSize() * toSend);
*/
}
pos += toSend;

View File

@ -1,5 +1,5 @@
/* Copyright (C) 2014 InfiniDB, Inc.
Copyright (C) 2019 MariaDB Corporation
Copyright (C) 2019-2021 MariaDB Corporation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -1480,10 +1480,10 @@ bool addFunctionJoin(vector<uint32_t>& joinedTables, JobStepVector& joinSteps,
TupleInfo ti1 = getTupleInfo(key1, jobInfo);
TupleInfo ti2 = getTupleInfo(key2, jobInfo);
if (ti1.dtype == CalpontSystemCatalog::CHAR
|| ti1.dtype == CalpontSystemCatalog::VARCHAR
|| ti1.dtype == CalpontSystemCatalog::TEXT)
// || ti1.dtype == CalpontSystemCatalog::LONGDOUBLE)
// Enable Typeless JOIN for char and wide decimal types.
if (datatypes::isCharType(ti1.dtype) ||
(datatypes::isWideDecimalType(ti1.dtype, ti1.width) ||
datatypes::isWideDecimalType(ti2.dtype, ti2.width)))
m1->second.fTypeless = m2->second.fTypeless = true; // ti2 is compatible
else
m1->second.fTypeless = m2->second.fTypeless = false;

View File

@ -1736,13 +1736,13 @@ void TupleHashJoinStep::joinOneRG(uint32_t threadID, vector<RGData>* out,
{
(*tjoiners)[j]->match(largeSideRow, k, threadID, &joinMatches[j]);
/* Debugging code to print the matches
Row r;
smallRGs[j].initRow(&r);
cout << joinMatches[j].size() << " matches: \n";
for (uint32_t z = 0; z < joinMatches[j].size(); z++) {
r.setData(joinMatches[j][z]);
cout << " " << r.toString() << endl;
}
Row r;
smallRGs[j].initRow(&r);
cout << joinMatches[j].size() << " matches: \n";
for (uint32_t z = 0; z < joinMatches[j].size(); z++) {
r.setData(joinMatches[j][z]);
cout << " " << r.toString() << endl;
}
*/
matchCount = joinMatches[j].size();