繁体   English   中英

Spark Scala 中的任务不可序列化

[英]Task not serializable in Spark Scala

我试图从 RDD 中删除页脚,当我试图从 rdd 中删除最后一个索引时,它给了我任务不可序列化:

    at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.NotSerializableException: com.jetblue.azuredata.databricks.DatabricksParams
Serialization stack:
    - object not serializable (class: com.jetblue.azuredata.databricks.DatabricksParams, value: com.jetblue.azuredata.databricks.DatabricksParams@3fa5dd62)
    - field (class: line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw$$iw$$iw, name: ExtndCreditExpiryAccountParam, type: class com.jetblue.azuredata.databricks.DatabricksParams)
    - object (class line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw$$iw$$iw, line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw$$iw$$iw@2f729fd9)
    - field (class: line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw$$iw, name: $iw, type: class line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw$$iw$$iw)
    - object (class line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw$$iw, line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw$$iw@6fd7c3a5)
    - field (class: line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw, name: $iw, type: class line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw$$iw)
    - object (class line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw, line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw@7d5bdedc)
    - field (class: line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw, name: $iw, type: class line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw$$iw)
    - object (class line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw, line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw@7adc6739)
    - field (class: line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw, name: $iw, type: class line79556548b15244f587f1afdab47e1e8927.$read$$iw$$iw$$iw) ```
An the code:

    val totalCount  = ExtndCreditExpiryRawRdd.count
    val datawithinde = ExtndCreditExpiryRawRdd.zipWithIndex
    val cleanda = datawithinde.filter(row => row._2 < totalCount - 1 )

您是否尝试过将特征 Serializable ( https://www.scala-lang.org/api/2.12.3/scala/Serializable.html ) 添加到 ExtndCreditExpiryRawRdd 的类/对象中?

添加更多关于 ExtndCreditExpiryRawRdd 的代码或信息可能会有所帮助。

或者您是否尝试过这个相关问题的答案? Spark Scala:任务不可序列化错误

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM