1#ifndef SMOLLERGRAPH_PLAN_H_
2#define SMOLLERGRAPH_PLAN_H_
9#include "absl/status/statusor.h"
57 std::vector<std::string>
types{};
103 std::vector<std::vector<Cell>>
rows;
A graph kept in three files of records, one for nodes, one for relationships and one for their proper...
absl::StatusOr< Plan > PlanQuery(const Query &query)
Plans a query, starting from the node of its pattern that's cheapest to find, or for a shortest path,...
Result Run(const Plan &plan, const Graph &graph)
Runs a plan on a graph, a step at a time, each on all of the rows at once.
std::variant< int64_t, std::string > Value
A property's value, as the graph hands it out: a whole number or a string.
absl::StatusOr< Result > Execute(const Graph &graph, std::string_view text)
Parses, plans and runs a query in our subset of Cypher on a graph, in one call, as Kùzu's connection ...
std::string ValueText(const Value &value)
A value as sg query prints it: a number in digits, and a string as it is.
Direction
A node and a property take 64 bytes, and a relationship 24, so a page holds 170 relationships,...
std::string Explain(const Plan &plan)
The plan's steps, a line each, in the order they run, as EXPLAIN shows them.
A value a query returns, and the node it's a property of.
std::optional< Value > value
A column of what a plan returns: its heading, such as b.name, p or length(p), and the property of the...
A path through the graph: its nodes, from its start to its end, and the relationships between them,...
How to answer a query: where to start, and where to go from there.
std::vector< Step > steps
std::vector< Column > returns
What it returns, a column at a time, in order.
std::vector< std::string > slots
The pattern's variable for each slot, or nothing for a node it didn't give one.
A query in our subset of Cypher, such as MATCH (a {name: 'Red fox'})-[:EATS]->(b) WHERE b....
What a query returns: a row for each match of its pattern, with a cell for each column.
std::vector< std::vector< Cell > > rows
std::vector< std::string > columns
std::string weight
The property a cheapest path adds up.
Direction direction
Which of its node's relationships an expand or a path follows.
@ kShortestPath
For each row, a shortest path from the node in slot from to the node in slot to, along relationships ...
@ kNodeIndexSeek
A row for the node named text, in slot to, found in the index.
@ kCheapestPath
The same for a cheapest path, whose relationships' weight adds up to the least.
@ kHasLabel
The rows whose node in slot from has the label text.
@ kFilter
The rows whose node in slot from has a property text that compares with value as op says.
@ kExpand
For each row, a row for each node that a relationship of any of the types goes to from the node in sl...
@ kNodeByLabelScan
A row for each node with the label text, in slot to.
@ kAllNodesScan
A row for each node in the graph, in slot to.
std::vector< std::string > types
The relationship types an expand or a path follows.
std::string op
A filter's operator, and the value it compares with.