joda-time import stopped working in Spark shell

2.9k Views Asked by At

I'm trying to test some code in the Spark shell (spark v. 1.3.0, using Scala version 2.10.4) and in the past was able to import joda-time libraries like this:

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

Today when I started the shell on my local machine, I'm getting:

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._
                  ^

As far as I know nothing's changed overnight. Anyone ever seen this before?

1

There are 1 best solutions below

3
On

Not sure why I'm getting inconsistent behavior, but this seems to fix it.

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