Skip to main content

faucet_lineage/
lifecycle.rs

1//! Per-invocation lineage context the executor fills and hands to the emitter.
2
3use crate::column::ColumnLineage;
4use crate::config::ParentJob;
5use chrono::{DateTime, Utc};
6
7/// Inferred schema: ordered (field name, OL type string) pairs.
8#[derive(Debug, Clone, Default)]
9pub struct InferredSchema {
10    pub fields: Vec<(String, String)>,
11}
12
13/// A source/sink dataset identity.
14#[derive(Debug, Clone)]
15pub struct DatasetRef {
16    pub namespace: String,
17    pub name: String,
18}
19
20/// Everything needed to build a `RunEvent` for one invocation.
21#[derive(Debug, Clone)]
22pub struct RunLifecycle {
23    pub job_namespace: String,
24    pub job_name: String,
25    pub run_id: String,
26    pub parent: Option<ParentJob>,
27    pub input: DatasetRef,
28    pub output: DatasetRef,
29    pub started_at: DateTime<Utc>,
30    pub finished_at: Option<DateTime<Utc>>,
31    pub records: u64,
32    pub error: Option<String>,
33    pub input_schema: Option<InferredSchema>,
34    pub output_schema: Option<InferredSchema>,
35    pub column_lineage: Option<ColumnLineage>,
36    pub source_code: Option<String>,
37}