1

I am saving blob in cassandra by converting a text into a compressed blob using erlang function 'term_to_binary'. https://www.erlang.org/doc/man/erlang.html#term_to_binary-2

Is there a way to decode the above compressed blob to original text using a cqlsh query?

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Cpp crusaders
  • 117
  • 2
  • 10

1 Answers1

4

You can convert the blob back to an Erlang term with binary_to_term, but it cannot be done in cqlsh, it has to be done in Erlang/Elixir on the application level.

If you want to read from the database using a language which doesn't have binary_to_term, then you might be interested in BERT which is almost 100% compatible with Erlang Term Format and has libraries for Javascript and Ruby.

Alternatively, any other serialisation format like Piqi, JSON, XML etc would work.

erszcz
  • 1,630
  • 10
  • 16