Skip to main content

risingwave_frontend/optimizer/plan_node/generic/
iceberg_metadata_scan.rs

1// Copyright 2026 RisingWave Labs
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use std::collections::BTreeMap;
16
17use educe::Educe;
18use risingwave_common::catalog::Schema;
19use risingwave_connector::sink::iceberg::IcebergMetadataTableType;
20use risingwave_connector::source::iceberg::IcebergTimeTravelInfo;
21use risingwave_pb::secret::PbSecretRef;
22
23use super::GenericPlanNode;
24use crate::optimizer::optimizer_context::OptimizerContextRef;
25use crate::optimizer::property::FunctionalDependencySet;
26
27#[derive(Debug, Clone, Educe)]
28#[educe(PartialEq, Eq, Hash)]
29pub struct IcebergMetadataScan {
30    pub metadata_type: IcebergMetadataTableType,
31    pub properties: BTreeMap<String, String>,
32    pub secret_refs: BTreeMap<String, PbSecretRef>,
33    pub time_travel_info: Option<IcebergTimeTravelInfo>,
34
35    #[educe(PartialEq(ignore))]
36    #[educe(Hash(ignore))]
37    pub ctx: OptimizerContextRef,
38}
39
40impl GenericPlanNode for IcebergMetadataScan {
41    fn schema(&self) -> Schema {
42        self.metadata_type.schema()
43    }
44
45    fn stream_key(&self) -> Option<Vec<usize>> {
46        None
47    }
48
49    fn ctx(&self) -> OptimizerContextRef {
50        self.ctx.clone()
51    }
52
53    fn functional_dependency(&self) -> FunctionalDependencySet {
54        FunctionalDependencySet::new(self.metadata_type.schema().len())
55    }
56}