Skip to content

Commit

Permalink
Unify operator argument order to be <symbols> <plan+> <args*>
Browse files Browse the repository at this point in the history
  • Loading branch information
comnik committed Oct 1, 2018
1 parent a2f0125 commit 8d2703c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/plan/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ pub enum AggregationFn {
/// bindings for the specified symbols. Very WIP.
#[derive(Deserialize, Clone, Debug)]
pub struct Aggregate<P: Implementable> {
/// Logical predicate to apply.
pub aggregation_fn: AggregationFn,
/// TODO
pub variables: Vec<Var>,
/// Plan for the data source.
pub plan: Box<P>
pub plan: Box<P>,
/// Logical predicate to apply.
pub aggregation_fn: AggregationFn,
}

impl<P: Implementable> Implementable for Aggregate<P> {
Expand Down
4 changes: 2 additions & 2 deletions src/plan/antijoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ use {ImplContext, RelationMap, QueryMap, SimpleRelation, Var};
/// all of the same symbols in the same order.
#[derive(Deserialize, Clone, Debug)]
pub struct Antijoin<P1: Implementable, P2: Implementable> {
/// TODO
pub variables: Vec<Var>,
/// Plan for the left input.
pub left_plan: Box<P1>,
/// Plan for the right input.
pub right_plan: Box<P2>,
/// TODO
pub variables: Vec<Var>,
}

impl<P1: Implementable, P2: Implementable> Implementable for Antijoin<P1,P2> {
Expand Down
4 changes: 2 additions & 2 deletions src/plan/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ pub enum Predicate {
/// binds the argument symbols.
#[derive(Deserialize, Clone, Debug)]
pub struct Filter<P: Implementable> {
/// Logical predicate to apply.
pub predicate: Predicate,
/// TODO
pub variables: Vec<Var>,
/// Logical predicate to apply.
pub predicate: Predicate,
/// Plan for the data source.
pub plan: Box<P>
}
Expand Down
4 changes: 2 additions & 2 deletions src/plan/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ use {ImplContext, RelationMap, QueryMap, SimpleRelation, Var};
/// sources.
#[derive(Deserialize, Clone, Debug)]
pub struct Join<P1: Implementable, P2: Implementable> {
/// TODO
pub variables: Vec<Var>,
/// Plan for the left input.
pub left_plan: Box<P1>,
/// Plan for the right input.
pub right_plan: Box<P2>,
/// TODO
pub variables: Vec<Var>,
}

impl<P1: Implementable, P2: Implementable> Implementable for Join<P1,P2> {
Expand Down
8 changes: 4 additions & 4 deletions src/plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ pub enum Plan {
/// Data pattern of the form [?e a v]
MatchAV(Var, Attribute, Value),
/// Sources data from a query-local relation
RuleExpr(String, Vec<Var>),
RuleExpr(Vec<Var>, String),
/// Sources data from a published relation
NameExpr(String, Vec<Var>),
NameExpr(Vec<Var>, String),
}


Expand Down Expand Up @@ -131,7 +131,7 @@ impl Implementable for Plan {

SimpleRelation { symbols: vec![sym1], tuples }
},
&Plan::RuleExpr(ref name, ref syms) => {
&Plan::RuleExpr(ref syms, ref name) => {
match relation_map.get(name) {
None => panic!("{:?} not in relation map", name),
Some(named) => {
Expand All @@ -142,7 +142,7 @@ impl Implementable for Plan {
}
}
}
&Plan::NameExpr(ref name, ref syms) => {
&Plan::NameExpr(ref syms, ref name) => {
match queries.get_mut(name) {
None => panic!("{:?} not in query map", name),
Some(named) => {
Expand Down

0 comments on commit 8d2703c

Please sign in to comment.