Commit Graph

818 Commits

Author SHA1 Message Date
Dominik Gleich
bd0b81526e Initial version of mvcc_gc.
Summary:
Tested MVCC garbage collector.
Also refactors graph_db forward declarations of vertex and edge which were causing issues.

Reviewers: mislav.bradac, dtomicevic, florijan, teon.banek, buda

Reviewed By: teon.banek, buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D177
2017-03-29 12:38:24 +02:00
Dominik Gleich
45999d04be Fix mvcc bug.
Summary: Changing mvcc again. This should be double-checked since it's quite a substantial change. The test here tests for the new behaviour - which should be correct.

Reviewers: matej.gradicek, dtomicevic, buda

Reviewed By: matej.gradicek, buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D156
2017-03-29 10:50:52 +02:00
florijan
1303097cdd Query::Plan - removed tuples from test for clarity
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D196
2017-03-29 09:18:02 +02:00
Teon Banek
9d3b4aab4b Make Where and NamedExpression macros easier to use
Summary:
`Where` can now be constructed in a `QUERY`, instead of requiring manual
addition to `Match`. For example:

    auto query = QUERY(MATCH(pattern), WHERE(expr), ...);

compared to:

    auto match = MATCH(pattern);
    match->where_ = WHERE(expr);
    auto query = QUERY(match, ...);

Similarly, `AS` can be used instead of `NEXPR` to create
`NamedExpressions` only with a name. This is meant to be used with
`RETURN` which will look at the previous `Expression` and store it
inside `NamedExpression`. For example:

    auto ret = RETURN(IDENT("n"), AS("n"),
                      PROPERTY_LOOKUP("n", prop), AS("prop_val"));

compared to:

    auto ret = RETURN(NEXPR("n", IDENT("n")),
                      NEXPR("prop_val", PROPERTY_LOOKUP("n", prop)));

Reviewers: florijan, mislav.bradac

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D195
2017-03-29 09:09:54 +02:00
florijan
af8df9e282 Query::Plan - Set logical ops implementation and testing. PropertyValueStore set() overriden to handle Null values as a removal instead of setting them. PropertyValueStore.clear() function added.
Reviewers: buda, teon.banek, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D194
2017-03-29 08:51:12 +02:00
Marko Budiselic
d00c08bf15 Bolt PullAll works.
Summary: Bolt PullAll works. ChunkedBuffer is implemented by the specification (the tests can be found in the tests/unit/bolt_chunked_buffer.cpp). Bolt session states method are refactored (all run methods have only one argument - active Session). Modifications related to the style guide.

Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D180
2017-03-28 12:43:04 +02:00
Teon Banek
68e94e64e4 Plan set operations
Summary:
Inline and remove GenProduce.
It doesn't do anything useful, so instantiating `Produce` can be done
inline.

Add dummy MakeCursor overrides for set operators so that the build passes.

Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D193
2017-03-28 12:23:52 +02:00
Mislav Bradac
e40bd83636 Add SET conversion from low to highlevel ast
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D192
2017-03-28 10:56:20 +02:00
Teon Banek
7c36529aec Move Variable::Type to Symbol
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D191
2017-03-28 10:43:53 +02:00
florijan
7b81b2b132 Query::Plan::Set - set ops API defined. ConsoleTest random graph generation modified
Reviewers: teon.banek, mislav.bradac, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D190
2017-03-28 09:39:06 +02:00
Teon Banek
d9500337f2 Add planning Delete operation
Reviewers: florijan, mislav.bradac

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D188
2017-03-27 16:30:35 +02:00
Teon Banek
4bfae46150 Add basic planning of WHERE
Summary:
Add testing unbound variable in WHERE

Remove some duplication in planner tests

Reviewers: florijan, mislav.bradac

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D186
2017-03-27 16:02:24 +02:00
florijan
d387651205 Query::Plan::Produce - added support for Produce without input
Reviewers: teon.banek, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D189
2017-03-27 15:55:25 +02:00
florijan
34cdbc2f39 Query::Plan::CreateExpand frame bugfix
Summary: CreateExpand now puts both node and edge on the frame. This is not unit-tested because it would require an infrastructure change, and the code is quite simple.

Reviewers: teon.banek, buda, mislav.bradac

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D187
2017-03-27 15:32:50 +02:00
florijan
1280e77fd3 Query - Logical - Delete op added and tested. Minor refactors.
Reviewers: buda, teon.banek, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D184
2017-03-27 14:57:44 +02:00
florijan
eca90c43b3 Query - LogicalOp - Filter op added
Reviewers: buda, teon.banek, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D176
2017-03-27 13:16:58 +02:00
Mislav Bradac
1cf4b95c58 Add ast nodes for SET clause
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D182
2017-03-27 11:41:04 +02:00
Teon Banek
71c2813f39 Update and refactor query unit tests
Summary:
Test multiple create
Add utility macros for easier creation of AST
Use test query macros when testing semantic analysis
Document the query test macros
Use query test macros in interpreter tests

Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D178
2017-03-27 10:18:15 +02:00
Mislav Bradac
6a547839e1 Where and delete from antlr to highlevel ast
Reviewers: teon.banek

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D181
2017-03-27 10:18:08 +02:00
Mislav Bradac
9c7acf780c Implement expression evaluation
Reviewers: buda

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D179
2017-03-24 17:44:05 +01:00
florijan
3a07a95f61 Query - EdgeFilter - test improvements and bugfix
Summary: EdgeFiltering on type was implemented wrong, requiring ALL the given edge types to be satisfied instead of OR. Added a test and fixed implementation. Also resolved a few TODOs in EdgeFilterTest.

Reviewers: buda, teon.banek, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D170
2017-03-24 14:18:05 +01:00
florijan
f9b91cf680 Query - Logical - CreateNode now accepts an optional input. If provided, CreateNode creates a node for each successful Pull from input. If not provided, CreateNode creates a single node
Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D173
2017-03-24 14:17:32 +01:00
florijan
63aae05ec0 GraphDbAccessor - DetachRemove - commands re-ordered for better (assumed) efficiency
Summary: See above

Reviewers: buda, dtomicevic

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D174
2017-03-24 14:17:04 +01:00
florijan
2215173a58 Utils - random graph generator hacked
Summary: RandomGraphGenerator added

Reviewers: teon.banek, mislav.bradac, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D165
2017-03-24 13:13:04 +01:00
Teon Banek
35668d5b9f Make GNU Readline dependency optional
Reviewers: florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D171
2017-03-24 12:42:45 +01:00
Dominik Gleich
087c56315e Fix engine.
Summary:
Test engine update.

https://docs.google.com/document/d/1rnFsCFock-K3ZbuvMiCYWhGS_m7-DZV37JtxWRClD_8/edit

Reviewers: mislav.bradac, dtomicevic, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D167
2017-03-24 12:37:01 +01:00
Teon Banek
c2c34336c3 Split symbol_generator.hpp to .cpp
Reviewers: florijan, mislav.bradac

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D172
2017-03-24 12:07:42 +01:00
florijan
11eb643a5e Query - REPL fixes
Summary: Minor fixes.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D168
2017-03-24 09:50:53 +01:00
Teon Banek
99a9bf5901 Abstract reducing a pattern to a function
Reviewers: mislav.bradac, florijan, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D162
2017-03-24 08:34:31 +01:00
Marko Budiselic
66d56820ac Cleanup of poc/. Only CMakeLists is left because it is reasonable to have a proof of concept folder.
Summary: Cleanup of poc/.

Reviewers: dgleich, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D166
2017-03-23 18:10:37 +01:00
Mislav Bradac
f146c458be Implement opencypher to ast expression conversion
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D164
2017-03-23 16:46:15 +01:00
Marko Budiselic
08c43e7c87 Coverage for test binaries is excluded.
Summary: Coverage for test binaries is excluded.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D161
2017-03-23 16:07:25 +01:00
florijan
f304dfef28 Query Console implemented
Summary: buda, teon.banek, mislav.bradac

Reviewers: mislav.bradac, buda, teon.banek

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D163
2017-03-23 15:51:25 +01:00
Marko Budiselic
e9357ea13b Bug fix implicit conversion from PropertyValue to TypedValue.
Summary: Bug fix implicit conversion from PropertyValue to TypedValue.

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: buda

Differential Revision: https://phabricator.memgraph.io/D160
2017-03-22 19:40:11 +01:00
Marko Budiselic
3b42cd2579 Everything is merged (communication + query engine) but we have to fix the PULL_ALL issue. 2017-03-22 17:57:06 +01:00
Matej Ferencevic
5a5ffface3 Modified hardcoded queries to use new encoder.
Summary:
Removed old encoder.

Changed namespace from bolt to communication::bolt.

Removed old include from new encoder.

Added an empty message success to encoder.

Changed order in communication::Server.

Changed bolt session to use new encoder.

Merge remote-tracking branch 'origin/dev' into mg_hardcoded_queries

Fixed PrintRecordStream.

Reviewers: buda, dgleich

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D158
2017-03-22 17:09:22 +01:00
florijan
b236694fd2 Query - entry.hpp renamed to interpreter.hpp, Engine renamed to Interpreter
Summary: Query - interpreter console hack

Reviewers: buda, teon.banek, mislav.bradac

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D157
2017-03-22 16:39:00 +01:00
Matej Ferencevic
3bf0bd40a7 Initial version of new bolt encoder.
Reviewers: dgleich, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D104
2017-03-22 16:13:47 +01:00
Teon Banek
8da6ce67c0 Add planning CreateExpand operator
Summary: Add planning CreateExpand operator. This is quite similar to planning Expand, but I wouldn't abstract the duplicated parts yet. Also, raise semantic error if creating bidirectional edges

Reviewers: buda, mislav.bradac, florijan

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D155
2017-03-22 15:41:50 +01:00
Dominik Gleich
f505c76189 Fix lock store bug.
Summary: Lock store was not locking properly. It created a lock object which was destructed in the end of function scope which caused bits to be set to UNLOCKED.

Reviewers: matej.gradicek, buda

Reviewed By: matej.gradicek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D154
2017-03-22 15:40:37 +01:00
florijan
83c20fd47f Query - LogicalOp - visitable bug fix
Summary: Made CreateExpand visitable (I forgot before landing).

Reviewers: teon.banek

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D153
2017-03-22 14:14:01 +01:00
florijan
981f93d575 Query - ExpandCreate, prop tests, MATCH_CREATE
Summary: Query - ExpandCreate op added (with tests). LogicalOp tests have property enabled. MATCH-CREATE test started but disabled due to MVCC.

Reviewers: buda, mislav.bradac, teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D150
2017-03-22 13:41:21 +01:00
Mislav Bradac
33eaf80344 Change thrown exception classes in cypher visitor
Reviewers: buda

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D151
2017-03-22 11:19:28 +01:00
Teon Banek
bff671af43 Add planning Expand logical operator
Summary:
Make LogicalOperator visitable.
Add unit tests for logical planner.
Add planning Expand logical operators.
Test planning edge expansion.
Add documentation to planner implementation.

Reviewers: florijan, buda, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D147
2017-03-22 10:58:42 +01:00
Teon Banek
b33a654137 Add basic type checking to SymbolGenerator
Summary:
Test for simple type mismatch of node/edge types.
Add basic type checking of variables.
Check for edge type when creating an edge.
Add documentation to private structs and methods.

Reviewers: mislav.bradac, buda, florijan

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D148
2017-03-22 10:49:52 +01:00
Dominik Gleich
6be2399ad1 Fix warnings all over the codebase.
Reviewers: florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D146
2017-03-22 09:32:06 +01:00
Mislav Bradac
8e7ccf6e83 Extract literals to ast
Summary:
Extract literals to ast Literal node
Fix bugs in TypedValue
Add tests for properties to cypher_main_visitor test

Reviewers: buda, florijan, dgleich, teon.banek

Reviewed By: dgleich, teon.banek

Subscribers: dgleich, pullbot

Differential Revision: https://phabricator.memgraph.io/D149
2017-03-21 15:23:54 +01:00
florijan
a2a4c28168 Query - Add expansion LogicalOp and tests
Summary: Query - AstTreeStorage - TODO for forwarding resolved

Reviewers: teon.banek, mislav.bradac, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D139
2017-03-21 11:26:05 +01:00
matej.gradicek
88a96c2ebd Fixed logging tests.
Summary: Fixed logging tests.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot, matej.gradicek

Differential Revision: https://phabricator.memgraph.io/D137
2017-03-20 08:18:52 +00:00
Teon Banek
bed9324da9 Use SYSTEM when including various library directories
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D144
2017-03-17 17:33:05 +01:00