I am trying to import spark.implicits._ Apparently, this is an object inside a class in scala. when i import it in a method like so:
def f() = {
val spark
I know this is old post but just would like to share my pointers on this I think the issue with the way you are declaring the sparkSession .When you declare sparkSession as var that does not make it immutable which can change later point of time .So it doesn't allow importing the implicits on that as it might lead to ambiguity as later stage it can be changed where as it's not same in case of val