@@ -13,18 +13,6 @@ use snafu::OptionExt;
1313
1414use crate :: crd:: { Error , ObjectHasNoNameSnafu , v1alpha1} ;
1515
16- /// The resolved OpenLineage job/app name and where it came from.
17- /// See [`v1alpha1::SparkApplication::resolved_openlineage_app_name`].
18- #[ derive( Clone , Debug , PartialEq ) ]
19- pub struct ResolvedOpenLineageAppName {
20- /// The resolved, non-blank name written to `spark.openlineage.appName`.
21- pub name : String ,
22- /// `true` when the name fell back to `metadata.name`; the controller then emits a warning event
23- /// because a per-run-unique name (e.g. an orchestrator-generated `-<timestamp>` suffix) fragments
24- /// backend run history.
25- pub from_metadata_name : bool ,
26- }
27-
2816/// Appends `value` to a comma-separated `--conf` value in `submit_conf`, preserving any existing
2917/// (e.g. user-supplied) entries and skipping `value` if it is already present. Used for the
3018/// OpenLineage keys that must accumulate rather than clobber (`spark.extraListeners`, `spark.jars`).
@@ -43,36 +31,26 @@ pub(crate) fn append_conf_csv(submit_conf: &mut BTreeMap<String, String>, key: &
4331}
4432
4533impl v1alpha1:: SparkApplication {
46- /// Resolves the stable OpenLineage job/app name and its provenance (MVP §5), in priority order:
34+ /// Resolves the stable OpenLineage job/app name (MVP §5), in priority order:
4735 /// 1. `spec.openLineage.appName`, else
4836 /// 2. `spark.app.name` from `sparkConf`, else
49- /// 3. `metadata.name` (a fallback the controller flags with a warning event, because a
50- /// per-run-unique name would fragment backend run history).
37+ /// 3. `metadata.name`.
5138 ///
5239 /// Always yields a non-blank name — which is exactly what fixes the intermittent `unknown` bug.
53- pub fn resolved_openlineage_app_name ( & self ) -> Result < ResolvedOpenLineageAppName , Error > {
40+ pub fn resolved_openlineage_app_name ( & self ) -> Result < String , Error > {
5441 if let Some ( app_name) = self
5542 . spec
5643 . open_lineage
5744 . as_ref ( )
5845 . and_then ( |open_lineage| open_lineage. app_name . clone ( ) )
5946 {
60- return Ok ( ResolvedOpenLineageAppName {
61- name : app_name,
62- from_metadata_name : false ,
63- } ) ;
47+ return Ok ( app_name) ;
6448 }
6549
6650 if let Some ( app_name) = self . spec . spark_conf . get ( "spark.app.name" ) {
67- return Ok ( ResolvedOpenLineageAppName {
68- name : app_name. clone ( ) ,
69- from_metadata_name : false ,
70- } ) ;
51+ return Ok ( app_name. clone ( ) ) ;
7152 }
7253
73- Ok ( ResolvedOpenLineageAppName {
74- name : self . metadata . name . clone ( ) . context ( ObjectHasNoNameSnafu ) ?,
75- from_metadata_name : true ,
76- } )
54+ self . metadata . name . clone ( ) . context ( ObjectHasNoNameSnafu )
7755 }
7856}
0 commit comments