Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move TestEnvironment from providing a SparkContext to providing a SparkSession #2498

Closed
lossyrob opened this issue Dec 3, 2017 · 1 comment
Milestone

Comments

@lossyrob
Copy link
Member

lossyrob commented Dec 3, 2017

In geotrellis.spark.testkit.TestEnvironment, we provide a SparkContext. We should provide a SparkSession; you can get a spark context from a spark session, but can't start a spark session after the spark context is already created, without some deprecated code.

@lossyrob lossyrob added this to the 2.0 milestone Dec 3, 2017
@metasim
Copy link
Member

metasim commented Dec 3, 2017

This is how I handle it in a subclass to TestEnvironment. As you state, causes a deprecation warning, which I'd love to get rid of:

  override implicit def sc: SparkContext = { _sc.setLogLevel("ERROR"); _sc }

  lazy val sqlContext: SQLContext = SQLContext.getOrCreate(_sc)

  implicit lazy val spark = sqlContext.sparkSession

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants