From f825e600e0c2c201e9e5b7905e8964b9fe52453c Mon Sep 17 00:00:00 2001 From: ice1000 Date: Fri, 7 Apr 2023 10:24:04 +0000 Subject: [PATCH] Simplify --- .../src/optimizer/plan_node/generic/hop_window.rs | 10 ++++++++++ .../src/optimizer/plan_node/logical_hop_window.rs | 10 ++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/frontend/src/optimizer/plan_node/generic/hop_window.rs b/src/frontend/src/optimizer/plan_node/generic/hop_window.rs index b2f6c40d21f54..9bb9597d1650c 100644 --- a/src/frontend/src/optimizer/plan_node/generic/hop_window.rs +++ b/src/frontend/src/optimizer/plan_node/generic/hop_window.rs @@ -127,6 +127,16 @@ impl HopWindow { } impl HopWindow { + pub fn output_window_start_col_idx(&self) -> Option { + self.internal2output_col_mapping() + .try_map(self.internal_window_start_col_idx()) + } + + pub fn output_window_end_col_idx(&self) -> Option { + self.internal2output_col_mapping() + .try_map(self.internal_window_end_col_idx()) + } + pub fn into_parts(self) -> (PlanRef, InputRef, Interval, Interval, Interval, Vec) { ( self.input, diff --git a/src/frontend/src/optimizer/plan_node/logical_hop_window.rs b/src/frontend/src/optimizer/plan_node/logical_hop_window.rs index 60a63ec427625..0bd9d8d8c9f20 100644 --- a/src/frontend/src/optimizer/plan_node/logical_hop_window.rs +++ b/src/frontend/src/optimizer/plan_node/logical_hop_window.rs @@ -118,13 +118,11 @@ impl LogicalHopWindow { } pub fn output_window_start_col_idx(&self) -> Option { - 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 { - 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 { @@ -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) -> Self { Self::new( self.input(),