1
0
Fork 0

Copy document collection in slice and splice for AqlItemBlocks

This commit is contained in:
Max Neunhoeffer 2014-08-05 13:50:56 +02:00
parent 135cce3250
commit 8d1ce3baf2
2 changed files with 18 additions and 0 deletions

View File

@ -125,6 +125,18 @@ AqlItemBlock* AqlItemBlock::splice (std::vector<AqlItemBlock*>& blocks) {
auto res = new AqlItemBlock(totalSize, nrRegs);
size_t pos = 0;
for (it = blocks.begin(); it != blocks.end(); ++it) {
if (it == blocks.begin()) {
for (RegisterId col = 0; col < nrRegs; ++col) {
res->getDocumentCollections().at(col)
= (*it)->getDocumentCollections().at(col);
}
}
else {
for (RegisterId col = 0; col < nrRegs; ++col) {
TRI_ASSERT(res->getDocumentCollections().at(col) ==
(*it)->getDocumentCollections().at(col));
}
}
for (size_t row = 0; row < (*it)->size(); ++row) {
for (RegisterId col = 0; col < nrRegs; ++col) {
res->setValue(pos+row, col, (*it)->getValue(row, col));

View File

@ -430,6 +430,9 @@ namespace triagens {
std::unordered_map<AqlValue, AqlValue> cache;
auto res = new AqlItemBlock(to - from, _nrRegs);
for (RegisterId col = 0; col < _nrRegs; col++) {
res->_docColls[col] = _docColls[col];
}
for (size_t row = from; row < to; row++) {
for (RegisterId col = 0; col < _nrRegs; col++) {
AqlValue& a(_data[row * _nrRegs + col]);
@ -459,6 +462,9 @@ namespace triagens {
std::unordered_map<AqlValue, AqlValue> cache;
auto res = new AqlItemBlock(to - from, _nrRegs);
for (RegisterId col = 0; col < _nrRegs; col++) {
res->_docColls[col] = _docColls[col];
}
for (size_t row = from; row < to; row++) {
for (RegisterId col = 0; col < _nrRegs; col++) {
AqlValue& a(_data[chosen[row] * _nrRegs + col]);