RE: NPE when using Joda DateTime

2016-01-15 Thread Spencer, Alex (Santander)
: tempDate.minusHours(1) works fine. Kind Regards, Alex. From: Romain Sagean [mailto:romain.sag...@hupi.fr] Sent: 15 January 2016 13:08 To: Sean Owen Cc: Spencer, Alex (Santander); Shixiong(Ryan) Zhu; user@spark.apache.org Subject: Re: NPE when using Joda DateTime Hi, I had a similar problem with Joda Time

Re: NPE when using Joda DateTime

2016-01-15 Thread Romain Sagean
Hi, I had a similar problem with Joda Time though i didn't use Kryo, the solution I found was to use standard java date and time classes instead of Joda. 2016-01-15 13:16 GMT+01:00 Sean Owen : > I haven't dug into this, but I agree that something that is transient > isn't meant to be restored by

RE: NPE when using Joda DateTime

2016-01-15 Thread Spencer, Alex (Santander)
ncer, Alex (Santander) Cc: Shixiong(Ryan) Zhu; user@spark.apache.org Subject: Re: NPE when using Joda DateTime I haven't dug into this, but I agree that something that is transient isn't meant to be restored by the default Java serialization mechanism. I'd expect the class handles resto

Re: NPE when using Joda DateTime

2016-01-15 Thread Sean Owen
I haven't dug into this, but I agree that something that is transient isn't meant to be restored by the default Java serialization mechanism. I'd expect the class handles restoring that value as needed or in a custom readObject method. And then I don't know how Kryo interacts with that. I don't th

RE: NPE when using Joda DateTime

2016-01-15 Thread Spencer, Alex (Santander)
...@databricks.com] Sent: 14 January 2016 21:57 To: Durgesh Verma Cc: Spencer, Alex (Santander); Todd Nist; Sean Owen; user@spark.apache.org Subject: Re: NPE when using Joda DateTime Could you try to use "Kryo.setDefaultSerializer" like this: class YourKryoRegistrator extends KryoRegistrator { ov

Re: NPE when using Joda DateTime

2016-01-14 Thread Shixiong(Ryan) Zhu
nd that's what originally made the single map statement > work: > > class MyRegistrator extends KryoRegistrator { > override def registerClasses(kryo: Kryo) { > kryo.register(classOf[org.joda.time.DateTime]) > } > } > > Is it because the groupBy sees a diff

Re: NPE when using Joda DateTime

2016-01-14 Thread Durgesh Verma
tried that yet. > > Kind Regards, > Alex. > > From: Todd Nist [mailto:tsind...@gmail.com] > Sent: 14 January 2016 16:28 > To: Spencer, Alex (Santander) > Cc: Sean Owen; user@spark.apache.org > Subject: Re: NPE when using Joda DateTime > > I had a simil

RE: NPE when using Joda DateTime

2016-01-14 Thread Spencer, Alex (Santander)
tried that yet. Kind Regards, Alex. From: Todd Nist [mailto:tsind...@gmail.com] Sent: 14 January 2016 16:28 To: Spencer, Alex (Santander) Cc: Sean Owen; user@spark.apache.org Subject: Re: NPE when using Joda DateTime I had a similar problem a while back and leveraged these Kryo serializers, https

Re: NPE when using Joda DateTime

2016-01-14 Thread Todd Nist
pe? Maybe > Array[DateTime]? I don’t want to find the answer by trial and error though. > > Alex > > -Original Message- > From: Sean Owen [mailto:so...@cloudera.com] > Sent: 14 January 2016 14:07 > To: Spencer, Alex (Santander) > Cc: user@spark.apache.org &

Re: NPE when using Joda DateTime

2016-01-14 Thread Sean Owen
om: Sean Owen [mailto:so...@cloudera.com] > Sent: 14 January 2016 14:07 > To: Spencer, Alex (Santander) > Cc: user@spark.apache.org > Subject: Re: NPE when using Joda DateTime > > It does look somehow like the state of the DateTime object isn't being > recreated properl

RE: NPE when using Joda DateTime

2016-01-14 Thread Spencer, Alex (Santander)
From: Sean Owen [mailto:so...@cloudera.com] Sent: 14 January 2016 14:07 To: Spencer, Alex (Santander) Cc: user@spark.apache.org Subject: Re: NPE when using Joda DateTime It does look somehow like the state of the DateTime object isn't being recreated properly on deserialization somehow, given w

Re: NPE when using Joda DateTime

2016-01-14 Thread Sean Owen
It does look somehow like the state of the DateTime object isn't being recreated properly on deserialization somehow, given where the NPE occurs (look at the Joda source code). However the object is java.io.Serializable. Are you sure the Kryo serialization is correct? It doesn't quite explain why