Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected SparkAppDriverConf buildDriverConf(
effectiveSparkConf.setIfMissing("spark.app.id", appId);
return SparkAppDriverConf.create(
effectiveSparkConf,
appId,
effectiveSparkConf.getAppId(),
Copy link
Member

@dongjoon-hyun dongjoon-hyun Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test case to SparkAppSubmissionWorkerTest.java.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @TQJADE .

primaryResource,
applicationSpec.getMainClass(),
applicationSpec.getDriverArgs().toArray(String[]::new),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,20 @@ void generatedSparkAppIdShouldComplyLengthLimit() {
String appId = SparkAppSubmissionWorker.generateSparkAppId(mockApp);
assertTrue(appId.length() <= DEFAULT_ID_LENGTH_LIMIT);
}

@Test
void checkAppIdWhenUserSpecifiedInSparkConf() {
SparkApplication mockApp = mock(SparkApplication.class);
ApplicationSpec mockSpec = mock(ApplicationSpec.class);
Map<String, String> appProps = new HashMap<>();
appProps.put("spark.app.id", "foo");
ObjectMeta appMeta = new ObjectMetaBuilder().withName("app1").withNamespace("ns1").build();
when(mockSpec.getSparkConf()).thenReturn(appProps);
when(mockApp.getSpec()).thenReturn(mockSpec);
when(mockApp.getMetadata()).thenReturn(appMeta);

SparkAppSubmissionWorker submissionWorker = new SparkAppSubmissionWorker();
SparkAppDriverConf conf = submissionWorker.buildDriverConf(mockApp, Collections.emptyMap());
assertEquals(conf.appId(), "foo");
}
}
Loading