[SPARK-53869] Support multiple files in pyFiles field
#382
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR aims to support multiple files in
SparkApplication'spyFilesfield.Why are the changes needed?
Currently,
pyFilesis mapped to the main resource directly because it assumes a single Python file.spark-kubernetes-operator/spark-submission-worker/src/main/java/org/apache/spark/k8s/operator/SparkAppSubmissionWorker.java
Line 143 in 75515c7
However, it's supposed to be a comma-separated string. If users provide multiple files, t causes a failure like the following.
This PR proposes a mitigation to handle the first file of
pyFilesas the primary resource and the rest of files as the realpyFiles. Note that the previous logic works without any change and new logic is going to be applied only whenmainClassisorg.apache.spark.deploy.PythonRunnerspecified additionally.BEFORE
AFTER
Does this PR introduce any user-facing change?
No behavior change because new logic works only when
mainClassisorg.apache.spark.deploy.PythonRunner.How was this patch tested?
Pass the CIs with newly added test case.
Was this patch authored or co-authored using generative AI tooling?
No.