10000 Feature/aql subquery execution block impl execute implementation count collect by mchacki · Pull Request #11172 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Feature/aql subquery execution block impl execute implementation count collect #11172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
8b805d7
Move SubqueryStartExecutor to new interface
Jan 29, 2020
8ef2428
Diddle
Jan 31, 2020
2bda19d
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
Jan 31, 2020
147cd0c
Tests pass for SubqueryStartExecutor
Jan 31, 2020
cd694a1
Delete most of the SubqueryEndExecutor tests
Jan 31, 2020
7c5f90a
Skeleton tests
Feb 3, 2020
8f986f0
Junk
Feb 10, 2020
7332eff
Merge branch 'devel' into feature/AqlSubqueryExecutionBlockImplExecut…
Feb 10, 2020
fddf770
Cleanup and make work
Feb 11, 2020
6ddf0f1
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
Feb 11, 2020
1fe1772
Tweak ExecutorTestHelper to test pipelines
Feb 12, 2020
88ba3cd
SubqueryStart/SubqueryEnd
Feb 19, 2020
04de92e
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
Feb 19, 2020
1ae8cbc
Blafummel.
Feb 19, 2020
5881c54
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
Feb 20, 2020
041bd39
Modifications
Feb 20, 2020
de83c7b
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
Feb 20, 2020
187f38a
Fixup tests
Feb 20, 2020
7e33246
Address some comments
Feb 20, 2020
1b47090
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
Feb 20, 2020
bf0b03d
Fix.
Feb 20, 2020
aeb3541
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
Feb 20, 2020
f2baeba
Fix tests
Feb 20, 2020
c5c20f8
Various fixes.
Feb 21, 2020
fc32f25
Made the branch compile on Mac
mchacki Feb 21, 2020
4bb25ce
Intermediate commit, does not compile, required for merge
mchacki Feb 21, 2020
dde4c58
Fixed one of the SplicedSubqueryTests
mchacki Feb 21, 2020
81443f6
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
mchacki Feb 21, 2020
981b1ea
Seperated ShadowRow handling for SubqueryStart/End executors to get a…
mchacki Feb 21, 2020
a5099ef
Allow to use a fullCallStack in ExecutorTestHelper.
mchacki Feb 22, 2020
25e9c51
Added asserts on SubqueryEnd that is not allowed to be called with Sk…
mchacki Feb 22, 2020
24c8d27
Use AqlTestCase in SubqueryStartExecutorTest. Transformed first test …
mchacki Feb 22, 2020
fde3d31
Let ExecutorTestHelper also test for shadowRows
mchacki Feb 22, 2020
bc2ff3a
Adapted SingleInput=>Data+Shadow test to testing Helepr and make it pass
mchacki Feb 22, 2020
cf63e56
Transformed existing SubqueryStart tests to Helper, fixed a test wher…
mchacki Feb 22, 2020
238b905
Fixed Skip in SubqueryStartExecutor
mchacki Feb 23, 2020
6db38d2
Allow the Pipeline to add Consumer and dependency without fiddling wi…
mchacki Feb 23, 2020
8382a37
Added Skip adn ShadowRowForwarding tests to SubqueryStartExecutor
mchacki Feb 23, 2020
16c53a5
Fixed fullCount of SubqueryStart to be called properly.
mchacki Feb 23, 2020
2645708
Renamed isModificationSubquery -> isModificatioNode again
mchacki Feb 24, 2020
6c93d22
Consume more than one subquery en-block
mchacki Feb 24, 2020
5cb901b
Fixed debugReporting in SplicedSubqueryTest. Disabled the skip in sub…
mchacki Feb 24, 2020
c3b4551
Removed AQL debug log level from testing config
mchacki Feb 24, 2020
fca04a4
First version of Subquery Skip bypassing. Including 1 passing test.
mchacki Feb 24, 2020
da8ac78
Added disabled tests for skip, and proposed to do it later
mchacki Feb 24, 2020
43c7252
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
mchacki Feb 24, 2020
c208d55
Fixed reporting of FILTERED in fullCount of EnumerateCollectionExecutor
mchacki Feb 24, 2020
eb5dc91
Enable calculationExecutor execute interface
mchacki Feb 24, 2020
595d7ee
Fixed compile issues
mchacki Feb 24, 2020
2a132d2
To Velocypack the modification Subquery value
mchacki Feb 24, 2020
c509270
Fixed illegal assert and reactivated failure tests
mchacki Feb 25, 2020
cfbf0d8
Fixed compile issue
mchacki Feb 25, 2020
6a3e41f
Deactivated Calculation again
mchacki Feb 25, 2020
1dacb92
Added a testSuite for countCollectExecutor
mchacki Feb 25, 2020
03b6193
Fixed Subquery Test for CountCollect
mchacki Feb 25, 2020
a7f1e56
Added CountCollectImplementation
mchacki Feb 25, 2020
4d7bc3b
Added Compatibility Mode to AqlCallStack
mchacki Feb 26, 2020
24e68a5
Removed IdExecutor<void> the only feature it has can be moved into ID…
mchacki Feb 26, 2020
1335302
When falling back in BlocksWithClients use compatibility stack
mchacki Feb 26, 2020
5db3328
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
mchacki Feb 26, 2020
76a1797
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
mchacki Feb 26, 2020
f3df055
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
mchacki Feb 27, 2020
6c75a75
Fixed EnumerateCollectionExecutor
mchacki Feb 27, 2020
17f7169
Fixed fullCountBehaviour of EnumerateList. Also removed a unlimited,f…
mchacki Feb 27, 2020
f613876
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
mchacki Feb 28, 2020
53ccaa8
Fixed endless loop while skipAl in OperationCursor
mchacki Feb 28, 2020
d8d19a5
Fixed View Executor, which sends a no-limit no-offset upstream.
mchacki Feb 28, 2020
572ac97
Fixed forwarding in NoResultsExecutor
mchacki Feb 28, 2020
1bb0a29
Merge branch 'feature/AqlSubqueryExecutionBlockImplExecuteImplementat…
mchacki Feb 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tests pass for SubqueryStartExecutor
  • Loading branch information
Markus Pfeiffer committed Jan 31, 2020
commit 147cd0c0e180557232b7ef55e41284f307b00330
6 changes: 4 additions & 2 deletions arangod/Aql/SubqueryStartExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "Aql/SingleRowFetcher.h"
#include "Aql/Stats.h"

#include "Logger/LogMacros.h"

using namespace arangodb;
using namespace arangodb::aql;

Expand All @@ -50,7 +52,7 @@ auto SubqueryStartExecutor::produceRows(AqlItemBlockInputRange& input, OutputAql
// might have shadow rows we need to pass through
// We don't have a data row, but upstream might still have
// data to process
return {_upstreamState, NoStats{}, AqlCall{}};
return {input.upstreamState(), NoStats{}, AqlCall{}};
}
} break;
case State::PRODUCE_DATA_ROW: {
Expand All @@ -76,7 +78,7 @@ auto SubqueryStartExecutor::produceRows(AqlItemBlockInputRange& input, OutputAql
// When we reach here, then output is full
if (_produceState == State::READ_DATA_ROW) {
TRI_ASSERT(!_inputRow.isInitialized());
return {_upstreamState, NoStats{}, AqlCall{}};
return {input.upstreamState(), NoStats{}, AqlCall{}};
}
// PRODUCE_DATA_ROW should always immediately be processed without leaving the
// loop
Expand Down
165 changes: 61 additions & 104 deletions tests/Aql/SubqueryStartExecutorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
#include "RowFetcherHelper.h"
#include "gtest/gtest.h"

#include "Aql/AqlItemBlock.h"
#include "Aql/AqlItemBlockHelper.h"
#include "Aql/ExecutorInfos.h"
#include "Aql/InputAqlItemRow.h"
#include "Aql/OutputAqlItemRow.h"
#include "Aql/Stats.h"
#include "Aql/SubqueryStartExecutor.h"
Expand All @@ -32,6 +35,7 @@
#include <velocypack/Parser.h>
#include <velocypack/velocypack-aliases.h>

#include "Logger/LogMacros.h"
using namespace arangodb;
using namespace arangodb::aql;
using namespace arangodb::tests;
Expand Down Expand Up @@ -63,6 +67,9 @@ class SubqueryStartExecutorTest : public ::testing::Test {
protected:
ResourceMonitor monitor;
AqlItemBlockManager itemBlockManager{&monitor, SerializationFormat::SHADOWROWS};
SingleRowFetcherHelper<::arangodb::aql::BlockPassthrough::Disable> fetcher{
itemBlockManager, VPackParser::fromJson("[]")->steal(), false};
AqlCall call{};
};

TEST_F(SubqueryStartExecutorTest, check_properties) {
Expand All @@ -77,39 +84,45 @@ TEST_F(SubqueryStartExecutorTest, check_properties) {
}

TEST_F(SubqueryStartExecutorTest, empty_input_does_not_add_shadow_rows) {
SharedAqlItemBlockPtr block{new AqlItemBlock(itemBlockManager, 1000, 1)};
VPackBuilder input;
SingleRowFetcherHelper<::arangodb::aql::BlockPassthrough::Disable> fetcher(
itemBlockManager, input.steal(), false);
auto infos = MakeBaseInfos(1);

SubqueryStartExecutor testee(fetcher, infos);

NoStats stats{};
ExecutionState state{ExecutionState::HASMORE};
auto state = ExecutorState::HASMORE;

auto input = AqlItemBlockInputRange{ExecutorState::DONE};

SharedAqlItemBlockPtr block = itemBlockManager.requestBlock(1000, 1);
OutputAqlItemRow output{std::move(block), infos.getOutputRegisters(),
infos.registersToKeep(), infos.registersToClear()};
std::tie(state, stats) = testee.produceRows(output);
EXPECT_EQ(state, ExecutionState::DONE);

std::tie(state, stats, call) = testee.produceRows(input, output);

EXPECT_EQ(state, ExecutorState::DONE);
EXPECT_FALSE(output.produced());
EXPECT_EQ(output.numRowsWritten(), 0);
}

TEST_F(SubqueryStartExecutorTest, adds_a_shadowrow_after_single_input) {
SharedAqlItemBlockPtr block{new AqlItemBlock(itemBlockManager, 1000, 1)};
auto input = VPackParser::fromJson(R"([
["a"]
])");
SingleRowFetcherHelper<::arangodb::aql::BlockPassthrough::Disable> fetcher(
itemBlockManager, input->steal(), false);
SharedAqlItemBlockPtr block = itemBlockManager.requestBlock(1000, 1);

auto infos = MakeBaseInfos(1);
SubqueryStartExecutor testee(fetcher, infos);

NoStats stats{};
ExecutionState state{ExecutionState::HASMORE};
auto state = ExecutorState::HASMORE;

auto inputBlock = buildBlock<1>(itemBlockManager, MatrixBuilder<1>{{{{R"("a")"}}}});
auto input =
AqlItemBlockInputRange{ExecutorState::DONE, inputBlock, 0, inputBlock->size()};

OutputAqlItemRow output{std::move(block), infos.getOutputRegisters(),
infos.registersToKeep(), infos.registersToClear()};
std::tie(state, stats) = testee.produceRows(output);
EXPECT_EQ(state, ExecutionState::DONE);

std::tie(state, stats, call) = testee.produceRows(input, output);

EXPECT_EQ(state, ExecutorState::DONE);
EXPECT_FALSE(output.produced());
EXPECT_EQ(output.numRowsWritten(), 2);

Expand All @@ -119,23 +132,25 @@ TEST_F(SubqueryStartExecutorTest, adds_a_shadowrow_after_single_input) {
}

TEST_F(SubqueryStartExecutorTest, adds_a_shadowrow_after_every_input_line_in_single_pass) {
SharedAqlItemBlockPtr block{new AqlItemBlock(itemBlockManager, 1000, 1)};
auto input = VPackParser::fromJson(R"([
["a"],
["b"],
["c"]
])");
SingleRowFetcherHelper<::arangodb::aql::BlockPassthrough::Disable> fetcher(
itemBlockManager, input->steal(), false);
auto infos = MakeBaseInfos(1);
SubqueryStartExecutor testee(fetcher, infos);

NoStats stats{};
ExecutionState state{ExecutionState::HASMORE};
auto state = ExecutorState::HASMORE;

auto inputBlock =
buildBlock<1>(itemBlockManager,
MatrixBuilder<1>{{{{{R"("a")"}}}, {{{R"("b")"}}}, {{R"("c")"}}}});
auto input =
AqlItemBlockInputRange{ExecutorState::DONE, inputBlock, 0, inputBlock->size()};

SharedAqlItemBlockPtr block = itemBlockManager.requestBlock(1000, 1);
OutputAqlItemRow output{std::move(block), infos.getOutputRegisters(),
infos.registersToKeep(), infos.registersToClear()};
std::tie(state, stats) = testee.produceRows(output);
EXPECT_EQ(state, ExecutionState::DONE);

std::tie(state, stats, call) = testee.produceRows(input, output);

EXPECT_EQ(state, ExecutorState::DONE);
EXPECT_FALSE(output.produced());
EXPECT_EQ(output.numRowsWritten(), 6);

Expand All @@ -149,24 +164,25 @@ TEST_F(SubqueryStartExecutorTest, adds_a_shadowrow_after_every_input_line_in_sin
}

TEST_F(SubqueryStartExecutorTest, shadow_row_does_not_fit_in_current_block) {
auto input = VPackParser::fromJson(R"([
["a"],
["b"],
["c"]
])");
SingleRowFetcherHelper<::arangodb::aql::BlockPassthrough::Disable> fetcher(
itemBlockManager, input->steal(), false);
auto infos = MakeBaseInfos(1);
auto inputBlock =
buildBlock<1>(itemBlockManager,
MatrixBuilder<1>{{{{{R"("a")"}}}, {{{R"("b")"}}}, {{R"("c")"}}}});
auto input =
AqlItemBlockInputRange{ExecutorState::DONE, inputBlock, 0, inputBlock->size()};

SharedAqlItemBlockPtr block = itemBlockManager.requestBlock(3, 1);
OutputAqlItemRow output{std::move(block), infos.getOutputRegisters(),
infos.registersToKeep(), infos.registersToClear()};

SubqueryStartExecutor testee(fetcher, infos);

NoStats stats{};
ExecutionState state{ExecutionState::HASMORE};
auto state = ExecutorState::HASMORE;
{
SharedAqlItemBlockPtr block{new AqlItemBlock(itemBlockManager, 3, 1)};
OutputAqlItemRow output{std::move(block), infos.getOutputRegisters(),
infos.registersToKeep(), infos.registersToClear()};
std::tie(state, stats) = testee.produceRows(output);
EXPECT_EQ(state, ExecutionState::HASMORE);
std::tie(state, stats, call) = testee.produceRows(input, output);

EXPECT_EQ(state, ExecutorState::HASMORE);
EXPECT_FALSE(output.produced());
EXPECT_EQ(output.numRowsWritten(), 3);

Expand All @@ -176,11 +192,13 @@ TEST_F(SubqueryStartExecutorTest, shadow_row_does_not_fit_in_current_block) {
EXPECT_FALSE(block->isShadowRow(2));
}
{
SharedAqlItemBlockPtr block{new AqlItemBlock(itemBlockManager, 3, 1)};
SharedAqlItemBlockPtr block = itemBlockManager.requestBlock(3, 1);
OutputAqlItemRow output{std::move(block), infos.getOutputRegisters(),
infos.registersToKeep(), infos.registersToClear()};
std::tie(state, stats) = testee.produceRows(output);
EXPECT_EQ(state, ExecutionState::DONE);

std::tie(state, stats, call) = testee.produceRows(input, output);

EXPECT_EQ(state, ExecutorState::DONE);
EXPECT_FALSE(output.produced());
EXPECT_EQ(output.numRowsWritten(), 3);

Expand All @@ -190,64 +208,3 @@ TEST_F(SubqueryStartExecutorTest, shadow_row_does_not_fit_in_current_block) {
TestShadowRow(block, 2, true);
}
}

// TODO:
// This test can be enabled and should work as soon as the Fetcher skips non-relevant Subqueries
TEST_F(SubqueryStartExecutorTest, does_only_add_shadowrows_on_data_rows) {
SharedAqlItemBlockPtr block{new AqlItemBlock(itemBlockManager, 1000, 1)};
auto input = VPackParser::fromJson(R"([
["a"],
["b"],
["c"]
])");

auto infos = MakeBaseInfos(1);
{
SingleRowFetcherHelper<::arangodb::aql::BlockPassthrough::Disable> fetcher(
itemBlockManager, input->steal(), false);
SubqueryStartExecutor testee(fetcher, infos);

NoStats stats{};
ExecutionState state{ExecutionState::HASMORE};
OutputAqlItemRow output{std::move(block), infos.getOutputRegisters(),
infos.registersToKeep(), infos.registersToClear()};
std::tie(state, stats) = testee.produceRows(output);
EXPECT_EQ(state, ExecutionState::DONE);
EXPECT_FALSE(output.produced());
ASSERT_EQ(output.numRowsWritten(), 6);
block = output.stealBlock();
EXPECT_FALSE(block->isShadowRow(0));
TestShadowRow(block, 1, true);
EXPECT_FALSE(block->isShadowRow(2));
TestShadowRow(block, 3, true);
EXPECT_FALSE(block->isShadowRow(4));
TestShadowRow(block, 5, true);
// Taken from test above. We now have produced a block
// having 3 data rows alternating with 3 shadow rows
}
{
SingleRowFetcherHelper<::arangodb::aql::BlockPassthrough::Disable> fetcher(itemBlockManager,
6, false, block);
SubqueryStartExecutor testee(fetcher, infos);
block.reset(new AqlItemBlock(itemBlockManager, 1000, 1));

NoStats stats{};
ExecutionState state{ExecutionState::HASMORE};
OutputAqlItemRow output{std::move(block), infos.getOutputRegisters(),
infos.registersToKeep(), infos.registersToClear()};
std::tie(state, stats) = testee.produceRows(output);
EXPECT_EQ(state, ExecutionState::DONE);
EXPECT_FALSE(output.produced());
ASSERT_EQ(output.numRowsWritten(), 9);
block = output.stealBlock();
EXPECT_FALSE(block->isShadowRow(0));
TestShadowRow(block, 1, true);
TestShadowRow(block, 2, false);
EXPECT_FALSE(block->isShadowRow(3));
TestShadowRow(block, 4, true);
TestShadowRow(block, 5, false);
EXPECT_FALSE(block->isShadowRow(6));
TestShadowRow(block, 7, true);
TestShadowRow(block, 8, false);
}
}
0