You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Michal Augustýn <au...@gmail.com> on 2011/06/04 00:45:58 UTC

CQL - raw bytes values

Hello,

I have read a lot about CQL and I looked into source and it seems that
just string, long and uuid can be used as column name/value in CQL
commands. Is there any way how to works with "pure" bytes? I.e.
"SELECT BYTES(3412) FROM MyColumnFamily".
Actually, I wouldn't use CQL without this feature because I have some
data "compressed" - i.e. if I want to store some hash (MD5, SHA256)
then I store raw bytes.

Thanks!

Augi

Re: CQL - raw bytes values

Posted by Jonathan Ellis <jb...@gmail.com>.
You can use any AbstractType, including custom ones. The format
depends on AT.fromString; in the case of bytestype (CQL "bytea") this
is hex:

SELECT 'd54' FROM MyColumnFamily

On Fri, Jun 3, 2011 at 5:45 PM, Michal Augustýn
<au...@gmail.com> wrote:
> Hello,
>
> I have read a lot about CQL and I looked into source and it seems that
> just string, long and uuid can be used as column name/value in CQL
> commands. Is there any way how to works with "pure" bytes? I.e.
> "SELECT BYTES(3412) FROM MyColumnFamily".
> Actually, I wouldn't use CQL without this feature because I have some
> data "compressed" - i.e. if I want to store some hash (MD5, SHA256)
> then I store raw bytes.
>
> Thanks!
>
> Augi
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com