Commit Graph

181 Commits

Author SHA1 Message Date
Dominik Gleich
afbec0a26e Test GarbageCollector in skiplist.
Summary: Tests the skiplist GC.

Reviewers: florijan, mferencevic, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D145
2017-04-12 17:02:29 +02:00
Teon Banek
596b015e99 Correctly check variables inside property maps
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D271
2017-04-12 16:44:16 +02:00
florijan
ea202dc52a Query::Plan::EdgeFilter bugfix
Summary:
Resolved the bug where edge filters with no edge-types dont accept any edge.
Illustrated with the following queries:
CREATE ()-[]->()
MATCH ()-[]->()
	(produces 0 results, expected 1)

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D265
2017-04-12 13:47:27 +02:00
Teon Banek
355b9a9b9a Plan aggregation in WITH and RETURN clauses
Summary:
Generate symbols for aggregation results.
Plan aggregation in WITH clause.
Plan aggregation in RETURN clause.
Extract handling write clauses to a function.

Reviewers: mislav.bradac, florijan

Reviewed By: mislav.bradac, florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D236
2017-04-12 13:22:23 +02:00
Teon Banek
6cb1cdc607 Raise if setting label/property in CREATE on declared node
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D266
2017-04-12 11:11:27 +02:00
Mislav Bradac
36129cdcae Implement simple function conversion
Reviewers: buda

Reviewed By: buda

Subscribers: florijan, teon.banek

Differential Revision: https://phabricator.memgraph.io/D264
2017-04-11 19:14:08 +02:00
florijan
1273cea870 EdgeAccessor::is_cycle added. Query::Plan::Expand fixed
Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Differential Revision: https://phabricator.memgraph.io/D262
2017-04-11 15:52:01 +02:00
florijan
593e4e72b9 Query::Plan::Aggregate
Summary:
- Aggregation LogicalOperation added, with tests.

- Added capabilities to TypedValue (hash, bool-equality)
to support std::unordered_map<TypedValue>.

- Removed some bad code from utils/hashing/fnv and added
a hashing function for collections.

Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: lion, pullbot

Differential Revision: https://phabricator.memgraph.io/D252
2017-04-11 15:12:06 +02:00
Mislav Bradac
dfa6800edd Add aggregation conversion from antlr to ast
Reviewers: teon.banek

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D260
2017-04-11 14:55:26 +02:00
florijan
7981bd19e0 Query::Plan - const correctness
Summary:
Made all LogicalOperators const correct.
Fixed one LogicalOperator test.
Added explicit return values to Frame and SymbolTable at and [] methods.

Reviewers: teon.banek

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D259
2017-04-11 14:27:56 +02:00
Mislav Bradac
d92caf1163 Check clauses ordering
Reviewers: buda, florijan, teon.banek

Reviewed By: buda, teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D257
2017-04-11 12:30:17 +02:00
Teon Banek
804d0b09b9 Move typed_value to query top level and namespace it
Summary:
Upgraded old uses of TypedValue.
Also, implemented operator<< for EdgeAccessor and VertexAccessor.

Reviewers: buda, florijan, mislav.bradac, mferencevic

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D251
2017-04-11 08:50:46 +02:00
Mislav Bradac
b7ee09785b Implement IS NULL and IS NOT NULL
Reviewers: teon.banek, florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D254
2017-04-10 16:55:58 +02:00
Dominik Gleich
fd2780155a Refactor GC to use scheduler.
Reviewers: buda, matej.gradicek

Reviewed By: matej.gradicek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D247
2017-04-10 15:57:45 +02:00
Teon Banek
9855621c9e Fix planning CREATE with expanding a created node
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D253
2017-04-10 15:11:23 +02:00
Dominik Gleich
e8fd479bbc Fix memory leak. Refactor mvcc. Revert commit function to old and introduce new one.
Summary:
Update tests.

Documentation:
https://phabricator.memgraph.io/w/memgraph_implementation/mvcc/

Reviewers: mislav.bradac, florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D227
2017-04-10 12:16:03 +02:00
Dominik Gleich
aca6b8f38b Fix dead code - and accompanying warnings.
Reviewers: mferencevic, matej.gradicek, mislav.bradac

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D248
2017-04-10 09:11:30 +02:00
Mislav Bradac
7a58ec5afb Fix bug in parenthesized expression
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D249
2017-04-07 18:33:07 +02:00
Dominik Gleich
2032466e2a New version of scheduler.
Summary: New scheduler declaration.

Reviewers: matej.gradicek, buda

Reviewed By: matej.gradicek

Differential Revision: https://phabricator.memgraph.io/D246
2017-04-07 11:55:10 +02:00
Matej Ferencevic
72f7b64c8f Logger in this test somehow breaks code coverage. Argh...
Reviewers: buda, dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D240
2017-04-07 09:44:12 +02:00
Matej Ferencevic
e5c814e022 First version of new bolt decoder and tests.
Summary:
Extracted constants to codes.hpp.

Extracted bolt constants.

Extracted StreamBuffer and fixed data type.

Extracted bolt testdata.

Added bolt buffer and tests.

Added bolt decoder buffer and tests.

Renamed bolt testdata.

Reviewers: dgleich, buda, matej.gradicek

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D220
2017-04-06 14:30:19 +02:00
Teon Banek
aa6cae0b16 Plan WITH clause without aggregation
Summary: Generate symbols for WITH clause.

Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D231
2017-04-06 14:10:28 +02:00
Dominik Gleich
8c7ed8c186 Add edge_types indexes.
Summary: Refactor label_index. Also add edge_type indexes.

Reviewers: mislav.bradac, florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D217
2017-04-05 17:23:12 +02:00
Mislav Bradac
a0049c9691 Convert With clause from antlr to high level ast
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D230
2017-04-05 16:22:46 +02:00
florijan
4c73a0a71c Query::Plan::Accumulate[Advance] implementation and test
Summary: see above

Reviewers: teon.banek, buda, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D226
2017-04-05 15:04:58 +02:00
matej.gradicek
5243ab00c2 Scheduler and tests.
Reviewers: dgleich, buda

Reviewed By: dgleich, buda

Subscribers: pullbot, matej.gradicek

Differential Revision: https://phabricator.memgraph.io/D213
2017-04-05 08:43:43 +00:00
Teon Banek
b33b671505 Plan multiple MATCH clauses and multiple patterns
Reviewers: mislav.bradac, florijan

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D218
2017-04-05 09:23:03 +02:00
Mislav Bradac
6112454b08 Throw exception on trailing text in query
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D222
2017-04-04 18:48:55 +02:00
florijan
e2949a88ce Storage::EdgeAccessor::set_edge_type removed
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D221
2017-04-04 16:58:30 +02:00
florijan
9eb4428023 Query::Plan::ScanAll accepts optional input (for cartesian)
Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D219
2017-04-04 16:58:05 +02:00
florijan
bffc406662 Query::Plan - ExpansionUniquenessFilter
Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D214
2017-04-04 12:20:01 +02:00
Teon Banek
05d19f6218 Use new/old on Accessor in logical operators
Summary:
Replace includes in operator.hpp with forward declarations.
Provide basic documentation for remaining operators.
Use SwitchOld on accessors used in Expand and Filter operations.
Add SwitchOld and SwitchNew to ExpressionEvaluator.
Evaluate new or old state in operators.
Test operators use correct accessors.
Add some basic tests for cases where switching accessors to old and new
matters.

Reviewers: mislav.bradac, buda, florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D208
2017-04-03 15:37:06 +02:00
florijan
9ce2081103 Storage::RecordAccessor - added multiple pointers to RecordAcessors and switching capabilities. Rewired GraphDbAccessor and VersionList accordingly. Added tests for new RecordAccessor functions.
Reviewers: teon.banek, dtomicevic, mislav.bradac, dgleich, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D207
2017-04-03 12:29:56 +02:00
Dominik Gleich
863f55dc2f Labels implementation.
Summary: Labels implementation

Reviewers: buda, teon.banek

Reviewed By: buda, teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D201
2017-04-03 11:50:22 +02:00
Teon Banek
a3da7cd5a8 Plan Remove operators
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D203
2017-03-30 13:56:25 +02:00
florijan
d3692d439c Query::Plan::Operator - split into hpp and cpp
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D204
2017-03-30 13:48:16 +02:00
florijan
5134a94f1c Query::Plan - RemoveLabels added and tested
Summary:
Query::Plan::RemoveProperty op added and tested

Query::AST:: Remove added to cypher main visitor. Tested. Grammar corrected on missing whitespace in removeItem production

Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D202
2017-03-30 08:53:18 +02:00
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
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