Skip to content

Commit

Permalink
feat(cognitarium): handle query engine for loop join
Browse files Browse the repository at this point in the history
  • Loading branch information
amimart committed Jun 5, 2023
1 parent 65e09ee commit f9af316
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contracts/okp4-cognitarium/src/querier/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ impl<'a> QueryEngine<'a> {
QueryNode::CartesianProductJoin { left, right } => {
Box::new(move |_| Box::new(iter::empty()))
}
QueryNode::ForLoopJoin { left, right } => Box::new(move |_| Box::new(iter::empty())),
QueryNode::ForLoopJoin { left, right } => {
let left = self.eval_node(left);
let right = self.eval_node(right);
Box::new(move |vars| -> ResolvedVariablesIterator {
Box::new(left(vars).flat_map(move |v| right(v)))
})
}
QueryNode::Skip { child, first } => {
let upstream = self.eval_node(child);
Box::new(move |vars| -> ResolvedVariablesIterator {
Expand Down

0 comments on commit f9af316

Please sign in to comment.