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

Tongwei updated SPARK-52334:
----------------------------
    Description: 
When submitting a Spark job with the {{--files}} option and also calling 
{{SparkContext.addFile()}} for a file with the same name in the application 
code, Spark throws an exception ({_}And the same code does not throw an error 
in YARN mode{_}.)

*Reproduction Steps:*

1. Submit a Spark application using {{spark-submit}} with the {{--files}} 
option:
{code:java}
bin/spark-submit \ --files s3://bucket/a.text \ --class testDemo \ app.jar 
{code}
2. In the {{testDemo}} application code, call:
{code:java}
sc.addFile("a.text", true) {code}

Error msg:
{code:java}
Exception in thread "main" java.lang.IllegalArgumentException: requirement 
failed: File a.text was already registered with a different path (old path = 
/tmp/spark-6aa5129d-5bbb-464a-9e50-5b6ffe364ffb/a.text, new path = 
/opt/spark/work-dir/a.text{code}

  was:
When submitting a Spark job with the {{--files}} option and also calling 
{{SparkContext.addFile()}} for a file with the same name in the application 
code, Spark throws an exception due to a file registration conflict.

*Reproduction Steps:*
 # Submit a Spark application using {{spark-submit}} with the {{--files}} 
option:
{code:java}
bin/spark-submit \ --files s3://bucket/a.text \ --class testDemo \ app.jar 
{code}

 # In the {{testDemo}} application code, call:
 #  


> In Kubernetes mode, update all files, jars, archiveFiles, and pyFiles to 
> reference the working directory after they are downloaded.
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-52334
>                 URL: https://issues.apache.org/jira/browse/SPARK-52334
>             Project: Spark
>          Issue Type: Bug
>          Components: Kubernetes, Spark Core
>    Affects Versions: 4.0.0, 3.5.5
>            Reporter: Tongwei
>            Priority: Major
>
> When submitting a Spark job with the {{--files}} option and also calling 
> {{SparkContext.addFile()}} for a file with the same name in the application 
> code, Spark throws an exception ({_}And the same code does not throw an error 
> in YARN mode{_}.)
> *Reproduction Steps:*
> 1. Submit a Spark application using {{spark-submit}} with the {{--files}} 
> option:
> {code:java}
> bin/spark-submit \ --files s3://bucket/a.text \ --class testDemo \ app.jar 
> {code}
> 2. In the {{testDemo}} application code, call:
> {code:java}
> sc.addFile("a.text", true) {code}
> Error msg:
> {code:java}
> Exception in thread "main" java.lang.IllegalArgumentException: requirement 
> failed: File a.text was already registered with a different path (old path = 
> /tmp/spark-6aa5129d-5bbb-464a-9e50-5b6ffe364ffb/a.text, new path = 
> /opt/spark/work-dir/a.text{code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to