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
11
votes
1 answer

Scala pickling case class versioning

I would like to be able to use scala pickling in order to store binary representation of a case class. I would like to know if there is a way to manage versioning of case class (the way protocol buffer allows to do) Here is my example I make a…
Fred
  • 111
  • 2
9
votes
3 answers

Scala pickling: how?

I'm trying to use "pickling" serialization is Scala, and I see the same example demonstrating it: import scala.pickling._ import json._ val pckl = List(1, 2, 3, 4).pickle Unpickling is just as easy as pickling: val lst =…
Vadym Chekan
  • 4,977
  • 2
  • 31
  • 24
7
votes
2 answers

Scala Pickling and type parameters

I'm using Scala Pickling, an automatic serialization framework for Scala. According to the author's slides, any type T can be pickled as long as there is an implicit Pickler[T] in scope. Here, I'm assuming she means…
emchristiansen
  • 3,550
  • 3
  • 26
  • 40
5
votes
1 answer

Scala Pickling: Writing a custom pickler / unpickler for nested structures

I'm trying to write a custom SPickler / Unpickler pair to work around some the current limitations of scala-pickling. The data type I'm trying to pickle is a case class, where some of the fields already have their own SPickler and Unpickler…
emchristiansen
  • 3,550
  • 3
  • 26
  • 40
5
votes
1 answer

Scala Pickling usage MyObject -> Array[Byte] -> MyObject

I was trying to get into the new Scala Pickling library that was presented at the ScalaDays 2013: Scala Pickling What I am really missing are some simple examples how the library is used. I understood that I can pickle some object an unpickle it…
Björn Jacobs
  • 4,033
  • 4
  • 28
  • 47
4
votes
1 answer

Does scala-pickling work with Scala 2.11?

Is there any way to use scala-pickling with scala 2.11 yet? I've tried the only scala-pickling_2.11 artifact at the sonatype repository but it doesn't seem to work. I get the message: Error:(26, 43) can't expand macros compiled by previous versions…
countfloyd
  • 91
  • 5
4
votes
1 answer

Scala unpickling from string

I tried the following Unit Test. First test testUnpickleJsonPickleFormat works well. It pickles a String and unpickle the pickle. testUnpickleString{1,2} tests to unserialize a String. But they don't work at all. I don't know where something miss…
fsart
  • 113
  • 1
  • 7
3
votes
2 answers

Scala Pickling for Json serialization and deserialization?

For my project, dijon, I was wondering if it is possible to use Scala pickling for JSON serialization and deserialization. Specifically, I want something like this def toJsonString(json: JSON, prettyPrint: Boolean = false): String and def…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
3
votes
3 answers

Conflicting cross-version suffixes in: org.scalamacros:quasiquotes

I am trying to use scala-pickling in one of my projects. I tried to mimic the build file of macroid which seems to use pickling too but I keep getting this error on sbt test: [error] Modules were resolved with conflicting cross-version suffixes in…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
3
votes
1 answer

Unpickling when type is unknown

I'm trying to use Scala Pickling to program some generic unpickling logic. Say you have two types, A and B, and you pickle them into a byte array. You take this byte array and send it to another machine and that's received as a byte array. Now you…
Galder Zamarreño
  • 5,027
  • 2
  • 26
  • 34
3
votes
1 answer

Can't generate unpickler in class hierarchy when passing object params to parent

The example below pickles fine, but I get a compile error stating that no unpickler can be generated. Here is a simple test case to reproduce this: import scala.pickling._ import json._ object JsonTest extends App { val simplePickle = new…
kevin z
  • 75
  • 3
2
votes
0 answers

Unpickle/convert pyspark RDD of Rows to Scala RDD[Row]

What I'm trying to achieve is to execute Scala code. Convert result Scala RDD[Row] to PySparkRDD of Rows. Perform some python operations and convert RDD of pySpark Rows back to Scala's RDD[Row]. To get RDD to pySpark RDD I'm doing this: In Scala I…
Vitek
  • 21
  • 3
2
votes
1 answer

Using Scala Pickling serialization In APACHE SPARK over KryoSerializer and JavaSerializer

While searching best Serialization techniques for apache-spark I found below link https://github.com/scala/pickling#scalapickling which states Serialization in scala will be more faster and automatic with this framework. And as Scala Pickling has…
Sam
  • 139
  • 1
  • 10
2
votes
0 answers

How to write a custom pickler for a case class with a List member?

I am trying to write a custom pickler for a case class which has a List[String] member. I am currently using scala-pickling version 0.10.1 I am aware about the builder.beginCollection method to pickle collections, but I was not able to get any…
alva
  • 72
  • 8
2
votes
0 answers

scala.MatchError while unpickling json string of DenseVector

I tried pickling and unpickling an object of Breeze's (https://github.com/scalanlp/breeze) DenseVector class (http://www.scalanlp.org/api/breeze/#breeze.linalg.DenseVector). Didn't need to add any custom picklers. While pickling succeeded,…
devendraj
  • 21
  • 3
1
2 3