是否可以使用CQLSH查询来解码压缩斑点?
我通过使用erlang函数“ term_to_binary”将文本转换为压缩斑点,将斑点保存在Cassandra中。 https://www.erlang.org.org/doc/man/erlang。 HTML#TERM_TO_BINAL-2
是否有一种方法可以使用CQLSH查询将上述压缩斑点解码为原始文本?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
binary_to_term
将斑点转换回Erlang项,但是不能在cqlsh
中完成,必须在应用程序级别在Erlang/Elixir中完成。如果您想使用没有
binary_ter_term
的语言从数据库中读取,那么您可能对Bert感兴趣,Bert几乎与Erlang Term Format兼容,并且具有 javascript and 红宝石。另外,任何其他序列化格式,例如 piqi ,json,xml等都可以使用。
You can convert the blob back to an Erlang term with
binary_to_term
, but it cannot be done incqlsh
, 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.