I am learning scala and got know that we can save scala file using two extensions, that is my.sc and my.scala.
Here is the sample file which i created:
my.scala
object My {
/** Our main function where the action happens */
def main(args: Array[String]) {
Logger.getLogger("org").setLevel(Level.ERROR)
val sc = new SparkContext("local[*]", "my")
val lines = sc.textFile("readme.tx")
val results = lines.countByValue()
}
}
my.sc
object My {
val hello: String = "Hello World!"
println(hello)
}
What is the difference between the two?
When to use sc file extension and when to use scala file extension?