spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arun Lists <lists.a...@gmail.com>
Subject Re: Reading resource files in a Spark application
Date Wed, 14 Jan 2015 05:14:54 GMT
I experimented with using getResourceAsStream(cls, fileName) instead
cls.getResource(fileName).toURI. That works!

I have no idea why the latter method does not work in Spark. Any
explanations would be welcome.

Thanks,
arun


On Tue, Jan 13, 2015 at 6:35 PM, Arun Lists <lists.arun@gmail.com> wrote:

> In some classes, I initialize some values from resource files using the
> following snippet:
>
> new File(cls.getResource(fileName).toURI)
>
> This works fine in SBT. When I run it using spark-submit, I get a bunch of errors because
the classes cannot be initialized. What can I do to make such initialization that is Spark
friendly?
>
> Thanks,
> arun
>
>
>

Mime
View raw message