Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

gh-1988 - exit non-grouped existaggregate early #2144

Merged
merged 2 commits into from

2 participants

@jakesmith
Collaborator

For a non-grouped TAKexistsaggregate, once the 1st record is read, there's
not need to read rest of input

Signed-off-by: Jake Smith jake.smith@lexisnexis.com

jakesmith added some commits
@jakesmith jakesmith gh-1988 - exit non-grouped existaggregate early
For a non-grouped TAKexistsaggregate, once the 1st record is read, there's
not need to read rest of input

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
15be91f
@jakesmith jakesmith Clearer variable name
Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
8fe1a1c
@richardkchapman richardkchapman merged commit 3410b43 into hpcc-systems:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 20, 2012
  1. @jakesmith

    gh-1988 - exit non-grouped existaggregate early

    jakesmith authored
    For a non-grouped TAKexistsaggregate, once the 1st record is read, there's
    not need to read rest of input
    
    Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
  2. @jakesmith

    Clearer variable name

    jakesmith authored
    Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
This page is out of date. Refresh to see the latest.
View
14 thorlcr/activities/aggregate/thaggregateslave.cpp
@@ -182,11 +182,15 @@ class AggregateSlaveActivity : public AggregateSlaveBase
{
hadElement = true;
sz = helper->processFirst(resultcr, next);
- loop {
- next.setown(input->ungroupedNextRow());
- if (!next)
- break;
- sz = helper->processNext(resultcr, next);
+ if (container.getKind() != TAKexistsaggregate)
+ {
+ while (!abortSoon)
+ {
+ next.setown(input->ungroupedNextRow());
+ if (!next)
+ break;
+ sz = helper->processNext(resultcr, next);
+ }
}
}
doStopInput();
View
19 thorlcr/activities/aggregate/thgroupaggregateslave.cpp
@@ -22,7 +22,7 @@ class GroupAggregateSlaveActivity : public CSlaveActivity, public CThorDataLink
{
private:
- bool eof;
+ bool eof, ungroupedExistsAggregate;
IHThorAggregateArg * helper;
IThorDataLink *input;
@@ -47,9 +47,8 @@ class GroupAggregateSlaveActivity : public CSlaveActivity, public CThorDataLink
eof = false;
input=inputs.item(0);
startInput(input);
+ ungroupedExistsAggregate = (container.getKind() == TAKexistsaggregate) && !input->isGrouped();
dataLinkStart("GROUPAGGREGATE", container.queryId());
- if (!input->isGrouped())
- ActPrintLog("WARNING: non-grouped data as input to GroupAggregate");
}
void stop()
@@ -69,12 +68,16 @@ class GroupAggregateSlaveActivity : public CSlaveActivity, public CThorDataLink
if (row)
{
sz = helper->processFirst(out, row);
- loop
+ // NB: if ungrouped existsAggregate, no need to look at rest of input
+ if (!ungroupedExistsAggregate)
{
- row.setown(input->nextRow());
- if (!row)
- break;
- sz = helper->processNext(out, row);
+ while (!abortSoon)
+ {
+ row.setown(input->nextRow());
+ if (!row)
+ break;
+ sz = helper->processNext(out, row);
+ }
}
if (!input->isGrouped())
eof = true;
Something went wrong with that request. Please try again.