[TEST ERROR] org.apache.spark.sql.AnalysisException: Path does not exist

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[TEST ERROR] org.apache.spark.sql.AnalysisException: Path does not exist

Akmal Chaudhri
I am running the Spark DataFrame tests on Java code locally.

One test is failing because of a path issue. In the Java code is the line:

*//Load content of json file to data frame.*
*Dataset<Row> personsDataFrame =
spark.read().json("examples/src/main/resources/person.json");*

which works perfectly when the Java code is run.

However, if running the test, it cannot find the *person.json* file using
the above path. If I modify the path to:


*"../examples/src/main/resources/person.json"*

then it works fine. However, then the Java code fails.

I have searched on SO and Google and other people have reported similar
issues with Spark.

Is there any easy fix so that both the Java code and the test are happy?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: [TEST ERROR] org.apache.spark.sql.AnalysisException: Path does not exist

Dmitriy Pavlov
Hi Nikolay,

Could you please step in?

Sincerely,
Dmitriy Pavlov

вт, 17 апр. 2018 г. в 18:19, Akmal Chaudhri <[hidden email]>:

> I am running the Spark DataFrame tests on Java code locally.
>
> One test is failing because of a path issue. In the Java code is the line:
>
> *//Load content of json file to data frame.*
> *Dataset<Row> personsDataFrame =
> spark.read().json("examples/src/main/resources/person.json");*
>
> which works perfectly when the Java code is run.
>
> However, if running the test, it cannot find the *person.json* file using
> the above path. If I modify the path to:
>
>
> *"../examples/src/main/resources/person.json"*
>
> then it works fine. However, then the Java code fails.
>
> I have searched on SO and Google and other people have reported similar
> issues with Spark.
>
> Is there any easy fix so that both the Java code and the test are happy?
>
> Thank you.
>