gpt4 book ai didi

scala - joda-time 导入在 Spark shell 中停止工作

转载 作者:行者123 更新时间:2023-12-02 01:36:38 30 4
gpt4 key购买 nike

我正在尝试在 Spark shell(spark v. 1.3.0,使用 Scala 版本 2.10.4)中测试一些代码,过去能够像这样导入 joda-time 库:

import org.joda.time.DateTime
import org.joda.time.format.DateTimeFormatter
import org.joda.time.format.DateTimeFormat

今天,当我在本地机器上启动 shell 时,我得到:
scala> import org.joda.time.format.DateTimeFormat
<console>:19: error: object joda is not a member of package org
import org.joda.time.format.DateTimeFormat
^

scala> import org.joda.time.DateTime
<console>:19: error: object joda is not a member of package org
import org.joda.time.DateTime
^

scala> import org.joda.time._
<console>:19: error: object joda is not a member of package org
import org.joda.time._
^

据我所知,一夜之间什么都没有改变。有人见过这个吗?

最佳答案

不知道为什么我的行为不一致,但这似乎解决了它。

spark-shell --jars ~/jars/joda-time-2.8.1.jar

关于scala - joda-time 导入在 Spark shell 中停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30874230/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com