I am trying to run an application that prints "Hello World!". The script works fine locally, but every time I run it with
:load /path/to/script
output:
Loading /u/hdpdlcu/Matt/test/SparkScalaCourse/src/com/sundogsoftware/spark/test1.scala...
defined object test1
I have tried starting it with spark-shell with
spark-shell -i /path/to/script
but that also fails to produce the output "Hello World"
I have tried calling .Main as well.
scala> :load /u/hdpdlcu/Matt/test/SparkScalaCourse/src/com/sundogsoftware/spark/test1.scala Loading /u/hdpdlcu/Matt/test/SparkScalaCourse/src/com/sundogsoftware/spark/test1.scala... defined object test1
scala> /u/hdpdlcu/Matt/test/SparkScalaCourse/src/com/sundogsoftware/spark/test1.Main(Array("a")) :1: error: ';' expected but '.' found. /u/hdpdlcu/Matt/test/SparkScalaCourse/src/com/sundogsoftware/spark/test1.Main(Array("a"))
I tried removing path to file after defining object test1:
scala> :load /u/hdpdlcu/Matt/test/SparkScalaCourse/src/com/sundogsoftware/spark/test1.scala
Loading /u/hdpdlcu/Matt/test/SparkScalaCourse/src/com/sundogsoftware/spark/test1.scala...
defined object test1
scala> test1.main("a")
<console>:26: error: value main is not a member of object test1
test1.main("a")
^
scala> test1.main()
<console>:26: error: value main is not a member of object test1
test1.main()
^
test1.scala:
package com.sundogsoftware.spark
object test1 {
def Main (args: Array[String]) {
println("Hello World!")
}
}