Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 committed Apr 7, 2023
1 parent fea86be commit f825e60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 10 additions & 0 deletions src/frontend/src/optimizer/plan_node/generic/hop_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ impl<PlanRef: BatchPlanRef> HopWindow<PlanRef> {
}

impl<PlanRef: GenericPlanRef> HopWindow<PlanRef> {
pub fn output_window_start_col_idx(&self) -> Option<usize> {
self.internal2output_col_mapping()
.try_map(self.internal_window_start_col_idx())
}

pub fn output_window_end_col_idx(&self) -> Option<usize> {
self.internal2output_col_mapping()
.try_map(self.internal_window_end_col_idx())
}

pub fn into_parts(self) -> (PlanRef, InputRef, Interval, Interval, Interval, Vec<usize>) {
(
self.input,
Expand Down
10 changes: 2 additions & 8 deletions src/frontend/src/optimizer/plan_node/logical_hop_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@ impl LogicalHopWindow {
}

pub fn output_window_start_col_idx(&self) -> Option<usize> {
self.internal2output_col_mapping()
.try_map(self.core.internal_window_start_col_idx())
self.core.output_window_start_col_idx()
}

pub fn output_window_end_col_idx(&self) -> Option<usize> {
self.internal2output_col_mapping()
.try_map(self.core.internal_window_end_col_idx())
self.core.output_window_end_col_idx()
}

pub fn o2i_col_mapping(&self) -> ColIndexMapping {
Expand All @@ -135,10 +133,6 @@ impl LogicalHopWindow {
self.core.output2internal_col_mapping()
}

pub fn internal2output_col_mapping(&self) -> ColIndexMapping {
self.core.internal2output_col_mapping()
}

pub fn clone_with_output_indices(&self, output_indices: Vec<usize>) -> Self {
Self::new(
self.input(),
Expand Down

0 comments on commit f825e60

Please sign in to comment.