-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No Encoder found for java.time.Instant #88
Comments
Hello @take-it-out, What version of Scala/Spark are you using? The exception is quite strange because it tells us Spark cannot find its own encoder for (Just in case - you don't need to use |
thanks for you reply, I am using scala 2.12.8 and spark 2.4.0 . |
Thanks, we'll try out these versions (don't think we did). Meanwhile, could you please try this code: val events = spark.read.textFile(mySource)
.flatMap(line => Event.parse(line).toOption.map(_.toJson(true).noSpaces)) Because I was wrong saying that "Spark cannot find its own encoder for Instant whereas Instant is encoded into string by Analytics SDK" - in your code |
@chuwy thx, it works. |
Hey @take-it-out, hope you don't mind if it stays open for a bit. My concern is that our production systems use Analytics SDK in a way you shown with Spark 2.3, but I'm wondering why it doesn't work on 2.4. |
I have some troubles when upgrade my code to the latest sdk version 0.4.2 , but it was fine when using 0.2.1 before, here is my code:
then I got error below :
line 16 is
.flatMap(_.toOption)
, it seems that the Instant type in Event class cannnot be dealt correctly.Is there any ideas ?
The text was updated successfully, but these errors were encountered: