[ https://issues.apache.org/jira/browse/SPARK-38582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17507995#comment-17507995 ]
Apache Spark commented on SPARK-38582: -------------------------------------- User 'dcoliversun' has created a pull request for this issue: https://github.com/apache/spark/pull/35886 > Introduce `buildEnvVarsWithKV` and `buildEnvVarsWithFieldRef` for > `KubernetesUtils` to eliminate duplicate code pattern > ----------------------------------------------------------------------------------------------------------------------- > > Key: SPARK-38582 > URL: https://issues.apache.org/jira/browse/SPARK-38582 > Project: Spark > Issue Type: Improvement > Components: Kubernetes > Affects Versions: 3.2.1 > Reporter: qian > Priority: Minor > > There are many duplicate code patterns in Spark Code: > {code:java} > new EnvVarBuilder() > .withName(key) > .withValue(value) > .build() {code} > {code:java} > new EnvVarBuilder() > .withName(name) > .withValueFrom(new EnvVarSourceBuilder() > .withNewFieldRef(version, field) > .build()) > .build() > {code} > > [The assignment statement for executor envVar | > https://github.com/apache/spark/blob/branch-3.3/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala#L123-L185] > has 63 lines. We could introduce _buildEnvVarsWithKV_ and > _buildEnvVarsWithFieldRef_ function to simplify the above code patterns. -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org