Friday, 27 September 2013

Inserting a hard-coded UUID via CQLsh (Cassandra)

Inserting a hard-coded UUID via CQLsh (Cassandra)

Would like to populate some static test data via a CQLsh script.
This doesn't work: (device_id is UUID)
insert into devices (device_id, geohash,name, external_identifier,
measures, tags)
values
('c37d661d-7e61-49ea-96a5-68c34e83db3a','9q9p3yyrn1', 'Acme1', '936',
{'aparPower','actPower','actEnergy'},{'make':'Acme'});
Bad Request: Invalid STRING constant
(c37d661d-7e61-49ea-96a5-68c34e83db3a) for device_id of type uuid
I can't seem to find any CQL function to convert to proper type. Do I need
to do this from a python script?
Thanks, Chris

No comments:

Post a Comment