1
0
Fork 0

allow killing of Collect operations

This commit is contained in:
Jan Steemann 2016-01-13 13:47:03 +01:00
parent 0a1f1e5c4a
commit c577b8616e
2 changed files with 27 additions and 0 deletions

View File

@ -293,6 +293,11 @@ int SortedCollectBlock::getOrSkipSome(size_t atLeast, size_t atMost,
while (skipped < atMost) {
// read the next input row
TRI_IF_FAILURE("SortedCollectBlock::getOrSkipSomeOuter") {
THROW_ARANGO_EXCEPTION(TRI_ERROR_DEBUG);
}
throwIfKilled(); // check if we were aborted
bool newGroup = false;
if (!isTotalAggregation) {
@ -384,6 +389,8 @@ int SortedCollectBlock::getOrSkipSome(size_t atLeast, size_t atMost,
THROW_ARANGO_EXCEPTION(TRI_ERROR_DEBUG);
}
throwIfKilled();
emitGroup(cur, res.get(), skipped);
++skipped;
res->shrink(skipped);
@ -703,6 +710,12 @@ int HashedCollectBlock::getOrSkipSome(size_t atLeast, size_t atMost,
try {
while (skipped < atMost) {
TRI_IF_FAILURE("HashedCollectBlock::getOrSkipSomeOuter") {
THROW_ARANGO_EXCEPTION(TRI_ERROR_DEBUG);
}
throwIfKilled(); // check if we were aborted
groupValues.clear();
// for hashing simply re-use the aggregate registers, without cloning
@ -788,6 +801,8 @@ int HashedCollectBlock::getOrSkipSome(size_t atLeast, size_t atMost,
TRI_IF_FAILURE("HashedCollectBlock::getOrSkipSome") {
THROW_ARANGO_EXCEPTION(TRI_ERROR_DEBUG);
}
throwIfKilled();
}
++skipped;

View File

@ -145,6 +145,12 @@ function ahuacatlFailureSuite () {
assertFailingQuery("FOR i IN " + c.name() + " COLLECT key = i.value INTO g RETURN [ key, g ]");
assertFailingQuery("FOR i IN " + c.name() + " COLLECT key = i.value2 INTO g RETURN [ key, g ]");
assertFailingQuery("FOR i IN 1..10000 COLLECT key = i INTO g RETURN [ key, g ]");
internal.debugClearFailAt();
internal.debugSetFailAt("SortedCollectBlock::getOrSkipSomeOuter");
assertFailingQuery("FOR i IN " + c.name() + " COLLECT key = i.value INTO g RETURN [ key, g ]");
assertFailingQuery("FOR i IN " + c.name() + " COLLECT key = i.value2 INTO g RETURN [ key, g ]");
assertFailingQuery("FOR i IN 1..10000 COLLECT key = i INTO g RETURN [ key, g ]");
},
////////////////////////////////////////////////////////////////////////////////
@ -167,6 +173,12 @@ function ahuacatlFailureSuite () {
assertFailingQuery("FOR i IN " + c.name() + " COLLECT key = i.value RETURN key");
assertFailingQuery("FOR i IN " + c.name() + " COLLECT key = i.value2 RETURN key");
assertFailingQuery("FOR i IN 1..10000 COLLECT key = i RETURN key");
internal.debugClearFailAt();
internal.debugSetFailAt("HashedCollectBlock::getOrSkipSomeOuter");
assertFailingQuery("FOR i IN " + c.name() + " COLLECT key = i.value RETURN key");
assertFailingQuery("FOR i IN " + c.name() + " COLLECT key = i.value2 RETURN key");
assertFailingQuery("FOR i IN 1..10000 COLLECT key = i RETURN key");
},
////////////////////////////////////////////////////////////////////////////////