Retrieve list or set element in cassandra by index

Viewed 48

i'm importing json data to cassandra. Here is one of my table :

CREATE TABLE Geometry (
id TEXT, type TEXT, coordinates LIST<FLOAT>,
primary key (id)
);

As you can see I have coordinates which is a list of 3 elements like: [-12, 123, 4]. I would like to know if it's possible in Cassandra to retrieve only the last element of coordinates to do a query like :

select coordinates[2] from geometry where id='nc72001620';

Which would retrieve me 4 in my example. Note that I could change coordinates to a set if it's necessary. Thank you !

0 Answers
Related