Skip to content

Commit

Permalink
Fix optimisation for new operator types
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
  • Loading branch information
Licenser committed May 11, 2021
1 parent 0e71acb commit 816dd5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tremor-pipeline/src/executable_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl ExecutableGraph {
.iter()
.enumerate()
.filter_map(|(id, e)| {
if e.skippable() && e.kind == NodeKind::Operator {
if e.skippable() && e.kind.skippable() {
Some(id)
} else {
None
Expand Down
6 changes: 6 additions & 0 deletions tremor-pipeline/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ pub enum NodeKind {
Script,
}

impl NodeKind {
fn skippable(&self) -> bool {
matches!(self, Self::Operator | Self::Select | Self::Script)
}
}

impl Default for NodeKind {
fn default() -> Self {
Self::Operator
Expand Down

0 comments on commit 816dd5a

Please sign in to comment.