You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2021/02/08 13:54:08 UTC

[jira] [Updated] (SPARK-34231) AvroSuite has test failure when run from IDE due to bad loading of resource file

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

Hyukjin Kwon updated SPARK-34231:
---------------------------------
    Fix Version/s: 3.1.1

> AvroSuite has test failure when run from IDE due to bad loading of resource file
> --------------------------------------------------------------------------------
>
>                 Key: SPARK-34231
>                 URL: https://issues.apache.org/jira/browse/SPARK-34231
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL, Tests
>    Affects Versions: 3.2.0
>            Reporter: Erik Krogen
>            Assignee: Erik Krogen
>            Priority: Major
>             Fix For: 2.4.8, 3.0.2, 3.1.1, 3.1.2
>
>
> Within {{AvroSuite}} the test {{Ignore corrupt Avro file if flag IGNORE_CORRUPT_FILES enabled}} attempts to load a resource file like:
> {code}
>         val srcFile = new File("src/test/resources/episodes.avro")
>         val destFile = new File(dir, "episodes.avro")
>         FileUtils.copyFile(srcFile, destFile)
> {code}
> This works okay when tests are run via Maven/sbt , but really isn't the right way to access a resource, causing failures when run via IntelliJ, and actually {{episodes.avro}} has already been loaded properly as {{episodesAvro}}. Switch over to loading it properly:
> {code}
>         Files.copy(
>           Paths.get(new URL(episodesAvro).toURI),
>           Paths.get(dir.getCanonicalPath, "episodes.avro"))
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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