I work with following table:
CREATE TABLE IF NOT EXISTS lp_registry.domain (
ownerid text,
name1st text,
name2nd text,
name3rd text,
registrar text,
registered timestamp,
expiration timestamp,
updated timestamp,
technologies list<text>,
techversions list<text>,
ssl boolean,
PRIMARY KEY (
(name1st, name2nd, name3rd),
registrar, ownerid, registered, expiration, updated
)
);
Table isn't updated only new rows are added. Everytime crawler checks domain, new row is added.
I am performing this select:
SELECT * FROM lp_registry.domain WHERE
registrar = 'REG-WEDOS' AND
ownerid = 'FORPSI-JAF-S497436'
ALLOW FILTERING;
But what I want in the result are only the rows with latest 'updated' value for each unique "name3rd.name2nd.name1st".
If I were in a standard SQL database, I would use nested select with MAX or GROUP BY. However, this is not supported by Cassandra (MAX(), DISTINCT and group by in Cassandra). But what I should do in CQL?