Kamil Czarnogorski
Kamil Czarnogorski

Reputation: 165

Is it possible to use python aerospike client to read blob data inserted with JAVA client

Whenever I use query.results() on my query for aformentioned blob data I get empty array, query.foreach(dummy) with dummy callback produces segmentation fault, data blob was inserted using JAVA client with no custom serialization

Upvotes: 1

Views: 324

Answers (2)

Ronen Botzer
Ronen Botzer

Reputation: 7117

Aerospike has a list of supported data types, which currently is integer, double, string, bytes (blob), list, map, geoJSON. Native language types will map directly to and from the supported types, so in Python the client converts str to as_string, int to as_integer, float to as_double, etc.

The way the Python client would serialize in and out of a BLOB is into a bytearray. The Java client should use the Bin.asBlob() method ahead of writing the record.

Upvotes: 1

sunil
sunil

Reputation: 3567

When you are writing blob data using Java, if you are using byte array as bin type, you should be able to read it in python. If you are creating bin with Object datatype, the java serializer will be used to write the blob. You cannot reach such blob in python.

Upvotes: 3

Related Questions