cql3 - In cassandra cqlsh, how do I select from map<ascii, ascii> in a table? -
basically here how table set up:
create table points ( name ascii, id varint, attributes map<ascii, ascii>, primary key (name, id) )
and if run following select statement returned:
select id, attributes points limit 5;
id | attributes ----+------------------------------------------ 1 | {station/name: abc, type: 2, pfreq: 101} 2 | {station/name: abc, type: 1, pfreq: 101} 3 | {station/name: def, type: 1, pfreq: 103} 4 | {station/name: ghi, type: 2, pfreq: 105} 5 | {station/name: ghi, type: 1, pfreq: 105}
what able form clause based on info inside of attributes. following statement:
select id points name = 'name' , attributes['pfreq'] = 101;
however, when run following error:
bad request: line 1:56 no viable alternative @ input '['
i looked @ this discussion , seems though not supported yet, true? or there way filter on attributes information?
here versions working with:
[cqlsh 4.1.1 | cassandra 2.0.7 | cql spec 3.1.1 | thrift protocol 19.39.0]
yes true, instead can use contains:
select * points attributes contains 101;
Comments
Post a Comment