risingwave_frontend/optimizer/plan_node/generic/
recursive_union.rsuse pretty_xmlish::StrAssocArr;
use risingwave_common::catalog::Schema;
use super::{impl_distill_unit_from_fields, GenericPlanNode, GenericPlanRef};
use crate::binder::ShareId;
use crate::optimizer::property::FunctionalDependencySet;
use crate::OptimizerContextRef;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecursiveUnion<PlanRef> {
pub id: ShareId,
pub base: PlanRef,
pub recursive: PlanRef,
}
impl<PlanRef: GenericPlanRef> GenericPlanNode for RecursiveUnion<PlanRef> {
fn functional_dependency(&self) -> FunctionalDependencySet {
self.recursive.functional_dependency().clone()
}
fn schema(&self) -> Schema {
self.recursive.schema().clone()
}
fn stream_key(&self) -> Option<Vec<usize>> {
let fields_len = self.base.schema().len();
let base = self.base.stream_key();
if let Some(base) = base {
let mut base = base.to_vec();
base.push(fields_len);
Some(base)
} else {
None
}
}
fn ctx(&self) -> OptimizerContextRef {
self.recursive.ctx()
}
}
impl<PlanRef: GenericPlanRef> RecursiveUnion<PlanRef> {
pub fn fields_pretty<'a>(&self) -> StrAssocArr<'a> {
vec![]
}
}
impl_distill_unit_from_fields!(RecursiveUnion, GenericPlanRef);