I don\'t understand a behavior of spark.
I create an udf wich return an Integer like below
import org.apache.spark.sql.SQLContext
import org.apache.
Since I can't reproduce the issue copy-pasting just your example code into a new file, I bet that in your real code String
is actually shadowed by something else. To verify this theory you can try to change you signature to
def testString() : scala.Predef.String = {
return "myString"
}
or
def testString() : java.lang.String = {
return "myString"
}
If this one compiles, search for "String" to see how you shadowed the standard type. If you use IntelliJ Idea, you can try to use "Ctrl+B" (GoTo) to find it out. The most obvious candidate is that you used String
as a name of generic type parameter but there might be some other choices.