I have a script running in a paragraph with the Spark interpreter in Zeppelin. It has an import and the name imported can be resolved from the global namespace and also from a function, but not from a method inside a class.
This runs well on my computer's installation of Scala (2.12) but it doesn't work in Zeppelin (Scala 2.11).
import java.util.Calendar
def myFun: String = {
// this works
return Calendar.getInstance.toString
}
class MyClass {
def myFun(): String = {
// this doesn't
return Calendar.getInstance.toString
// this works
return java.util.Calendar.getInstance.toString
}
}
The error message is like:
import java.util.Calendar
myFun: String
<console>:15: error: not found: value Calendar
return Calendar.getInstance.toString
What am I missing?