Questions tagged [scala-pickling]

Scala Pickling is an automatic serialization framework made for Scala.

Scala Pickling is an automatic serialization framework made for Scala. Refer to the project page.

43 questions
2
votes
1 answer

Scala Pickling doesn't seem to work with Point2D.Double

I'm working on a Scala program that uses the Scala Pickling library to serialize and deserialize a Map object that contains a String and a Point2D.Double object from the java.awt.geom package. Here's the relevant logic: contents += new…
chaorace
  • 69
  • 1
  • 10
2
votes
1 answer

Serializing to disk and deserializing Scala objects using Pickling

Given a stream of homogeneous typed object, how would I go about serializing them to binary, writing them to disk, reading them from disk and then deserializing them using Scala Pickling? For example: object PicklingIteratorExample extends App { …
2
votes
1 answer

I've got error for generating pickler/unpickler for a type with type-parameter

I'm trying to use scala-pickling for my project; but I've got a problem with it. let assume that I've got this code: import scala.pickling._ import scala.pickling.Defaults._ import scala.pickling.json._ sealed trait State case class…
Reza Same'ei
  • 819
  • 8
  • 22
2
votes
0 answers

Scala pickling with JSON list

I'm trying to "unpickle" JSON structures like the following with Scala-pickling : {"id":1,"aList":[{"x":1}, {"x":2}]} Sadly when unpickling with the following code: import scala.pickling._, scala.pickling.Defaults._, json._ val…
raphael
  • 93
  • 8
2
votes
1 answer

Cannot Generate unpickler for case class with immutable HashMaps

I've recently come across scala-pickling and I'm trying to see how I can use it in a project, so I've been working through a simple example of a case class with immutable hashmaps. In this example, scala-pickling doesn't generate an unpickler and I…
innospark
  • 778
  • 1
  • 5
  • 8
2
votes
0 answers

Scala pickling: Simple custom pickler for my own class?

I am trying to pickle some relatively-simple-structured but large-and-slow-to-create classes in a Scala NLP (natural language processing) app of mine. Because there's lots of data, it needs to pickle and esp. unpickle quickly and without bloat. Java…
Urban Vagabond
  • 7,282
  • 3
  • 28
  • 31
2
votes
1 answer

Out of memory error during Scala compilation

I'm using the macro-heavy scala-pickling along with shapeless, and I keep crashing the Scala 2.10.3 compiler with an apparent out of memory error. The tail of the error message looks like this: [error] // tree.tpe=tasks.anonfun$218 [error]…
emchristiansen
  • 3,550
  • 3
  • 26
  • 40
2
votes
1 answer

Invalid index unpickling where object ref is repeated

I have a case where I'm pickling an object where a ref is repeated inside an object tree. I am getting an invalid index exception when unpickling. Below is a test case. import scala.pickling._ import json._ object JsonTest extends App { val obj =…
kevin z
  • 75
  • 3
1
vote
2 answers

scala-pickling in POJO in scala 2.11 - Is it really simple?

I'm trying to use scala-pickling because at site github it seems so easy and clean. But, I'm failing in use it in this simple REPL: scala> import scala.pickling._ import scala.pickling._ scala> import scala.pickling.Defaults._ import…
1
vote
3 answers

remove tpe from json after serialization via scala-pickling

Is there an easy way to serialize to json without "tpe" field inside an object? I need to serialize case classes to json structures and then, send them over the wire (They won't been deserialized in future). I have a specific api, so.. I don't need…
ppopoff
  • 658
  • 7
  • 17
1
vote
0 answers

Custom unpickler for Enumeration

I have an enumeration that I'm trying to pickle and unpickle with pickling 0.8.0 and scala 2.11: object CommandType extends Enumeration { val Push, Pop = Value } Pickling cannot do it automagically at the moment. The custom pickler-unpickler…
Yar
  • 629
  • 6
  • 17
1
vote
0 answers

Unpickler for Array of tuple

I am having an issue when I'm trying to unpickle an array of tuples. Here is the use case: import scala.pickling._ import json._ object JsonTest extends App { val simplePickled = new Simple(Array(("test", 3))).pickle val unpickled =…
kevin z
  • 75
  • 3
1
vote
1 answer

Unpickler for class with tuple

I recently came across this framework and it seems really promising for what I need. I am testing some simple examples out and I'm curious why I can pickle my object but it can't find an unpickler. Here is my example: import scala.pickling._ import…
kevin z
  • 75
  • 3
1
vote
2 answers

serialization (pickling / marshalling) in scala?

Are there are any examples, tutorials or docs for serialization / pickling / marshalling objects in Scala? I know of existence of scala.util.Marshal and scala.reflect.internal.pickling, but what is a difference between them? how can I use it? Is…
ts.
  • 10,510
  • 7
  • 47
  • 73
0
votes
0 answers

PicklingError: Could not serialize object: when calling exchange rate API into my pyspark dataframe

I am beginner in databricks and pyspark. Currently, I have a pyspark dataframe which contains 3 columns : Date amount Currency I would like to have the amount columns converted in EUR and calculated with the exchange rate of the day. For that…
Jeg
  • 3
  • 4