Skip to content
Open
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
12 changes: 11 additions & 1 deletion internal/pkg/object/command/sparkeks/sparkeks.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ type sparkEksJobContext struct {
Query string `yaml:"query,omitempty" json:"query,omitempty"`
Parameters *sparkEksJobParameters `yaml:"parameters,omitempty" json:"parameters,omitempty"`
ReturnResult bool `yaml:"return_result,omitempty" json:"return_result,omitempty"`
Arguments []string `yaml:"arguments,omitempty" json:"arguments,omitempty"`
}

type sparkEksClusterContext struct {
Expand Down Expand Up @@ -597,8 +598,17 @@ func applySparkOperatorConfig(execCtx *executionContext) {
s3aQueryURI := updateS3ToS3aURI(execCtx.queryURI)
s3aResultURI := updateS3ToS3aURI(execCtx.resultURI)
mainAppFile := s3aWrapperURI
if jobContext.ReturnResult {
if jobContext.ReturnResult && len(jobContext.Arguments) == 0 {
sparkApp.Spec.Arguments = []string{execCtx.appName, s3aQueryURI, execCtx.job.User, s3aResultURI}
} else if jobContext.ReturnResult && len(jobContext.Arguments) > 0 {
args := []string{execCtx.appName, execCtx.job.User}
args = append(args, jobContext.Arguments...) // jobContext.Arguments can have variable length of arguements
args = append(args, s3aResultURI) // make sure wrapper script should always consider last element of an arguements as s3aResultURI
sparkApp.Spec.Arguments = args
} else if len(jobContext.Arguments) > 0 {
Copy link
Contributor

@hladush hladush Oct 6, 2025

Choose a reason for hiding this comment

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

what if ReturnResult true and Arguments are provided? what should be happened?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please check now

args := []string{execCtx.appName, execCtx.job.User}
args = append(args, jobContext.Arguments...) // jobContext.Arguments can have variable length of arguements
sparkApp.Spec.Arguments = args
} else {
sparkApp.Spec.Arguments = []string{execCtx.appName, s3aQueryURI, execCtx.job.User}
}
Expand Down
Loading