-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add plan node for two-phase simple agg
- Loading branch information
Showing
5 changed files
with
325 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
src/frontend/src/optimizer/plan_node/stream_global_approx_percentile.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Copyright 2024 RisingWave Labs | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use pretty_xmlish::XmlNode; | ||
use risingwave_pb::stream_plan::stream_node::PbNodeBody; | ||
|
||
use crate::expr::{ExprRewriter, ExprVisitor}; | ||
use crate::optimizer::plan_node::expr_visitable::ExprVisitable; | ||
use crate::optimizer::plan_node::generic::GenericPlanRef; | ||
use crate::optimizer::plan_node::utils::{childless_record, watermark_pretty, Distill}; | ||
use crate::optimizer::plan_node::{ | ||
ExprRewritable, PlanBase, PlanTreeNodeUnary, Stream, StreamHopWindow, StreamKeyedMerge, | ||
StreamNode, | ||
}; | ||
use crate::stream_fragmenter::BuildFragmentGraphState; | ||
use crate::PlanRef; | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
pub struct StreamGlobalApproxPercentile { | ||
pub base: PlanBase<Stream>, | ||
} | ||
|
||
impl StreamGlobalApproxPercentile { | ||
pub fn new(input: PlanRef) -> Self { | ||
Self { base: todo!() } | ||
} | ||
} | ||
|
||
impl Distill for StreamGlobalApproxPercentile { | ||
fn distill<'a>(&self) -> XmlNode<'a> { | ||
todo!() | ||
} | ||
} | ||
|
||
impl PlanTreeNodeUnary for StreamGlobalApproxPercentile { | ||
fn input(&self) -> PlanRef { | ||
todo!() | ||
} | ||
|
||
fn clone_with_input(&self, input: PlanRef) -> Self { | ||
todo!() | ||
} | ||
} | ||
|
||
impl_plan_tree_node_for_unary! {StreamGlobalApproxPercentile} | ||
|
||
impl StreamNode for StreamGlobalApproxPercentile { | ||
fn to_stream_prost_body(&self, _state: &mut BuildFragmentGraphState) -> PbNodeBody { | ||
todo!() | ||
} | ||
} | ||
|
||
impl ExprRewritable for StreamGlobalApproxPercentile { | ||
fn has_rewritable_expr(&self) -> bool { | ||
todo!() | ||
} | ||
|
||
fn rewrite_exprs(&self, _rewriter: &mut dyn ExprRewriter) -> PlanRef { | ||
todo!() | ||
} | ||
} | ||
|
||
impl ExprVisitable for StreamGlobalApproxPercentile { | ||
fn visit_exprs(&self, v: &mut dyn ExprVisitor) { | ||
todo!() | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
src/frontend/src/optimizer/plan_node/stream_keyed_merge.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// Copyright 2024 RisingWave Labs | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use pretty_xmlish::XmlNode; | ||
use risingwave_pb::stream_plan::stream_node::PbNodeBody; | ||
use risingwave_pb::stream_plan::HopWindowNode; | ||
|
||
use crate::expr::{ExprRewriter, ExprVisitor}; | ||
use crate::optimizer::plan_node::expr_visitable::ExprVisitable; | ||
use crate::optimizer::plan_node::utils::Distill; | ||
use crate::optimizer::plan_node::{ | ||
ExprRewritable, PlanBase, PlanTreeNodeBinary, Stream, StreamHopWindow, | ||
StreamLocalApproxPercentile, StreamNode, | ||
}; | ||
use crate::stream_fragmenter::BuildFragmentGraphState; | ||
use crate::PlanRef; | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
pub struct StreamKeyedMerge { | ||
pub lhs_input: PlanRef, | ||
pub rhs_input: PlanRef, | ||
pub base: PlanBase<Stream>, | ||
} | ||
|
||
impl StreamKeyedMerge { | ||
pub fn new(lhs_input: PlanRef, rhs_input: PlanRef) -> Self { | ||
Self { | ||
lhs_input, | ||
rhs_input, | ||
base: todo!(), | ||
} | ||
} | ||
} | ||
|
||
impl Distill for StreamKeyedMerge { | ||
fn distill<'a>(&self) -> XmlNode<'a> { | ||
todo!() | ||
} | ||
} | ||
|
||
impl PlanTreeNodeBinary for StreamKeyedMerge { | ||
fn left(&self) -> PlanRef { | ||
todo!() | ||
} | ||
|
||
fn right(&self) -> PlanRef { | ||
todo!() | ||
} | ||
|
||
fn clone_with_left_right(&self, left: PlanRef, right: PlanRef) -> Self { | ||
todo!() | ||
} | ||
} | ||
|
||
impl_plan_tree_node_for_binary! { StreamKeyedMerge } | ||
|
||
impl StreamNode for StreamKeyedMerge { | ||
fn to_stream_prost_body(&self, _state: &mut BuildFragmentGraphState) -> PbNodeBody { | ||
todo!() | ||
} | ||
} | ||
|
||
impl ExprRewritable for StreamKeyedMerge { | ||
fn has_rewritable_expr(&self) -> bool { | ||
todo!() | ||
} | ||
|
||
fn rewrite_exprs(&self, _rewriter: &mut dyn ExprRewriter) -> PlanRef { | ||
todo!() | ||
} | ||
} | ||
|
||
impl ExprVisitable for StreamKeyedMerge { | ||
fn visit_exprs(&self, v: &mut dyn ExprVisitor) { | ||
todo!() | ||
} | ||
} |
Oops, something went wrong.