Skip to content

Commit 9fa3b9d

Browse files
committedJun 5, 2023
feat(cognitarium): handle engine limit query node
1 parent ee8254b commit 9fa3b9d

File tree

1 file changed

+6
-1
lines changed
  • contracts/okp4-cognitarium/src/querier

1 file changed

+6
-1
lines changed
 

‎contracts/okp4-cognitarium/src/querier/engine.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ impl<'a> QueryEngine<'a> {
3535
}
3636
QueryNode::ForLoopJoin { left, right } => Box::new(move |_| Box::new(iter::empty())),
3737
QueryNode::Skip { child, first } => Box::new(move |_| Box::new(iter::empty())),
38-
QueryNode::Limit { child, first } => Box::new(move |_| Box::new(iter::empty())),
38+
QueryNode::Limit { child, first } => {
39+
let upstream = self.eval_node(child);
40+
Box::new(move |vars| -> ResolvedVariablesIterator {
41+
Box::new(upstream(vars).take(first))
42+
})
43+
}
3944
}
4045
}
4146
}

0 commit comments

Comments
 (0)
Please sign in to comment.