mirror of https://gitee.com/bigwinds/arangodb
add initializeCursor back to DistinctCollectExecutor (#9386)
This commit is contained in:
parent
61f3397e33
commit
801c957348
|
@ -64,12 +64,11 @@ DistinctCollectExecutor::DistinctCollectExecutor(Fetcher& fetcher, Infos& infos)
|
||||||
AqlValueGroupEqual(_infos.getTransaction())) {}
|
AqlValueGroupEqual(_infos.getTransaction())) {}
|
||||||
|
|
||||||
DistinctCollectExecutor::~DistinctCollectExecutor() {
|
DistinctCollectExecutor::~DistinctCollectExecutor() {
|
||||||
// destroy all AqlValues captured
|
destroyValues();
|
||||||
for (auto& it : _seen) {
|
}
|
||||||
for (auto& it2 : it) {
|
|
||||||
const_cast<AqlValue*>(&it2)->destroy();
|
void DistinctCollectExecutor::initializeCursor() {
|
||||||
}
|
destroyValues();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<ExecutionState, NoStats> DistinctCollectExecutor::produceRows(OutputAqlItemRow& output) {
|
std::pair<ExecutionState, NoStats> DistinctCollectExecutor::produceRows(OutputAqlItemRow& output) {
|
||||||
|
@ -138,3 +137,13 @@ std::pair<ExecutionState, size_t> DistinctCollectExecutor::expectedNumberOfRows(
|
||||||
// but it is upper bounded by the input.
|
// but it is upper bounded by the input.
|
||||||
return _fetcher.preFetchNumberOfRows(atMost);
|
return _fetcher.preFetchNumberOfRows(atMost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DistinctCollectExecutor::destroyValues() {
|
||||||
|
// destroy all AqlValues captured
|
||||||
|
for (auto& it : _seen) {
|
||||||
|
for (auto& it2 : it) {
|
||||||
|
const_cast<AqlValue*>(&it2)->destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_seen.clear();
|
||||||
|
}
|
||||||
|
|
|
@ -96,6 +96,8 @@ class DistinctCollectExecutor {
|
||||||
DistinctCollectExecutor(Fetcher& fetcher, Infos&);
|
DistinctCollectExecutor(Fetcher& fetcher, Infos&);
|
||||||
~DistinctCollectExecutor();
|
~DistinctCollectExecutor();
|
||||||
|
|
||||||
|
void initializeCursor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief produce the next Row of Aql Values.
|
* @brief produce the next Row of Aql Values.
|
||||||
*
|
*
|
||||||
|
@ -107,6 +109,7 @@ class DistinctCollectExecutor {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Infos const& infos() const noexcept { return _infos; };
|
Infos const& infos() const noexcept { return _infos; };
|
||||||
|
void destroyValues();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Infos const& _infos;
|
Infos const& _infos;
|
||||||
|
|
|
@ -372,6 +372,9 @@ std::pair<ExecutionState, Result> ExecutionBlockImpl<Executor>::initializeCursor
|
||||||
static_assert(!std::is_same<Executor, IndexExecutor>::value || customInit,
|
static_assert(!std::is_same<Executor, IndexExecutor>::value || customInit,
|
||||||
"IndexExecutor is expected to implement a custom "
|
"IndexExecutor is expected to implement a custom "
|
||||||
"initializeCursor method!");
|
"initializeCursor method!");
|
||||||
|
static_assert(!std::is_same<Executor, DistinctCollectExecutor>::value || customInit,
|
||||||
|
"DistinctCollectExecutor is expected to implement a custom "
|
||||||
|
"initializeCursor method!");
|
||||||
InitializeCursor<customInit>::init(_executor, _rowFetcher, _infos);
|
InitializeCursor<customInit>::init(_executor, _rowFetcher, _infos);
|
||||||
|
|
||||||
// // use this with c++17 instead of specialisation below
|
// // use this with c++17 instead of specialisation below
|
||||||
|
|
Loading…
Reference in New Issue