【发布时间】:2019-08-15 04:19:22
【问题描述】:
您通常如何修复下面的“java.io.Serializable”错误?
我猜我的函数中的数据类型导致了它(?)。你如何避免它或将结果改回正确的类型。
def allKeys(sampledf: DataFrame): DataFrame = {......}
val afd12= afd.schema.fieldNames.contains("ID") && afd.schema.fieldNames.contains("CONNECTIDS") match {
case true => allKeys(afd)
case false => "no"
}
afd12.printSchema()
这是我得到的错误:
afd: java.io.Serializable = [ID: string, ADDITIONALINFO: string ... 87 more fields]
<console>:95: error: value printSchema is not a member of java.io.Serializable
afd12.printSchema()
^
【问题讨论】:
标签: scala apache-spark