You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.1 KiB
2.1 KiB
Structure of the project
- Parser
- Query AST
- Typing support
- Logical plan/optimizers
- Physical plan/optimizers
- Runtime representation (values)
- DB interaction/(de)serialization
- Evaluator/interpreter/VM
- Plan executors
{
*id: id,
name: d.name[0]
}
$name
${name:?Int}
where a: b.id == c.id
trail
select ...
view X = select {} : Vertex
let z = select {} : Vertex
from(e:Employee)
.where(e.id > 10)
.select(x: {id: e.id, name: e.first_name ++ e.last_name})
.skip(10)
.take(20);
from(e:Employee-[hj:HasJob]->j:Job)
.where(e.id == 20)
.select({..j});
query DoThis(x:Int, y:Any) {
return select(-[v:V]->)
.where(v.id >= x, v.data == y);
}
query DoThat(r:Rel(*id: Int)) {
...
}
global query XXX() {
...
}
Operations on relations
Operations
from(...rels)
, can use chain notationjoin(left, right, ...conds)
left_join(left, right, ...conds)
, similarly forright_join
,outer_join
)intersect(...rels)
, similarly forunion
diff(left, right)
, similarly forsym_diff
select(rel, binding: {..})
where(rel, ..conds)
take(rel, n)
skip(rel, n)
sort(rel, expr1, expr2: sort_dir)
group(rel, binding: {*key1: expr1, val1: expr2})
window(rel, ...)
, maybe various flavoursfreeze(rel)
, disables structural optimizationmaterialize(rel)
, forces materializationmerge(...rels)
, concat data cols, key cols must be the same, if names clash last wins. Same forleft_merge
,right_merge
,outer_merge
walk(pattern, ...conds, ...bindings)
walk_repeat(pattern, ...conds, ...bindings)
every element contains additional_iter
and_visited
fieldsvalues(data, ?Table)
nested_values(data, ?Table).extract(Table)
as(rel, Table)
as_keyed_by(rel, Table)
update(rel, Table)
delete(rel, Table)
insert(rel, Table)
upsert(rel, Table)
Helpers
print(rel)
print_schema(rel)
print_plan(rel)
print_optimized(rel)
Aggregation
- Aggregation functions should implement
.step()
and.result()