1use std::collections::HashMap;
2
3use feldera_types::program_schema::SourcePosition;
4use serde::Deserialize;
5use serde_json::Value;
6
7use crate::CalciteId;
8
9pub type MirNodeId = String;
10
11#[derive(Debug, Deserialize)]
12pub struct MirInput {
13 pub node: String,
14 pub output: usize,
15
16 #[serde(flatten)]
17 pub extra: HashMap<String, Value>,
18}
19
20#[derive(Debug, Deserialize)]
21pub struct MirNode {
22 #[serde(default)]
23 pub calcite: Option<CalciteId>,
24
25 #[serde(default)]
26 pub table: Option<String>,
27
28 #[serde(default)]
29 pub inputs: Vec<MirInput>,
30
31 pub operation: String,
32
33 #[serde(default)]
34 pub outputs: Option<Vec<MirInput>>,
35
36 #[serde(default)]
37 pub persistent_id: Option<String>,
38
39 #[serde(default)]
40 pub positions: Vec<SourcePosition>,
41
42 #[serde(flatten)]
43 pub extra: HashMap<String, Value>,
44}