Skip to content
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

Unexpected extraneous bytes after set value #625

Open
abhsrivastava opened this issue Nov 7, 2016 · 0 comments
Open

Unexpected extraneous bytes after set value #625

abhsrivastava opened this issue Nov 7, 2016 · 0 comments

Comments

@abhsrivastava
Copy link

abhsrivastava commented Nov 7, 2016

I tried to read a "set" data type from Cassandra in 3 ways

val genValue = col.getValue("genre", new SetSerializer[String](UTF8Type.instance), new java.util.HashSet[String]()).toSet

and

val setSer = new SetSerializer[String](UTF8Type.instance) val genres = col.getColumnByName("genres") val buf = genres.getByteArrayValue val genValue = setSer.fromBytes(buf)

I found these two approaches after a lot of googling and reading the discussions on astyanax google groups and github. But both these fail with error

org.apache.cassandra.serializers.MarshalException: Unexpected extraneous bytes after set value
at org.apache.cassandra.serializers.SetSerializer.deserialize(SetSerializer.java:64)
at org.apache.cassandra.serializers.SetSerializer.deserialize(SetSerializer.java:27)
at org.apache.cassandra.db.marshal.AbstractType.compose(AbstractType.java:142)
at com.netflix.astyanax.serializers.SetSerializer.fromByteBuffer(SetSerializer.java:32)
at com.netflix.astyanax.serializers.SetSerializer.fromByteBuffer(SetSerializer.java:19)
at com.netflix.astyanax.serializers.AbstractSerializer.fromBytes(AbstractSerializer.java:42)
at com.abhi.CassandraReader$.$anonfun$new$2(CassandraReader.scala:32)
at com.abhi.CassandraReader$.$anonfun$new$2$adapted(CassandraReader.scala:24)
at scala.collection.immutable.List.foreach(List.scala:378)
at com.abhi.CassandraReader$.delayedEndpoint$com$abhi$CassandraReader$1(CassandraReader.scala:24)
at com.abhi.CassandraReader$delayedInit$body.apply(CassandraReader.scala:16)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App.$anonfun$main$1$adapted(App.scala:76)

I have checked in my code sample here

https://github.com/abhsrivastava/AstyanaxScala

@abhsrivastava abhsrivastava changed the title Exceptions when using Astyanax code Unexpected extraneous bytes after set value Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant