[ 
https://issues.apache.org/jira/browse/SPARK-53980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dongjoon Hyun resolved SPARK-53980.
-----------------------------------
    Fix Version/s: 4.1.0
       Resolution: Fixed

Issue resolved by pull request 52693
[https://github.com/apache/spark/pull/52693]

> Add more flexible getAllWithPrefix for SparkConf
> ------------------------------------------------
>
>                 Key: SPARK-53980
>                 URL: https://issues.apache.org/jira/browse/SPARK-53980
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 4.1.0
>            Reporter: Jiaan Geng
>            Assignee: Jiaan Geng
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.1.0
>
>
> We need to set some config related to S3 for our inner Spark. The 
> implementation of the function show below.
> {code:java}
> private def setS3Configs(conf: SparkConf): Unit = {
>     val S3A_PREFIX = "spark.fs.s3a"
>     val SPARK_HADOOP_S3A_PREFIX = "spark.hadoop.fs.s3a"
>     val s3aConf = conf.getAllWithPrefix(S3A_PREFIX)
>     s3aConf
>       .foreach(
>         confPair => {
>           val keyWithoutPrefix = confPair._1
>           val oldKey = S3A_PREFIX + keyWithoutPrefix
>           val newKey = SPARK_HADOOP_S3A_PREFIX + keyWithoutPrefix
>           val value = confPair._2
>           (newKey, value)
>         })
>   }
> {code}
> These code seems redundant and complicated. The reason is getAllWithPrefix 
> only return the suffix part.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to