Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. Connected to Test Cluster at 127.0.0.1:9042.
  2. [cqlsh 5.0.1 | Cassandra 3.7.0 | CQL spec 3.4.2 | Native protocol v4]
  3.  
  4. CREATE TABLE population.residents (
  5. residentId bigint,
  6. name varchar,
  7. office varchar,
  8. dob date,
  9. citizen text,
  10. PRIMARY KEY((residentId), dob)
  11. );
  12.  
  13. CREATE MATERIALIZED VIEW population.residents_citizen AS
  14. SELECT citizen, dob, residentid, name, office
  15. FROM population.residents
  16. WHERE citizen IS NOT NULL AND residentid IS NOT NULL AND dob IS NOT NULL
  17. PRIMARY KEY (citizen, dob, residentid);
  18.  
  19. cqlsh> select citizen, count(residentId) from population.residents_citizen GROUP BY citizen;
  20. SyntaxException: line 1:68 missing EOF at 'GROUP' (...(residentId) from population.residents_citizen [GROUP] BY...)
  21.  
  22. cqlsh> select * from population.residents;
  23.  
  24. residentid | dob | citizen | name | office
  25. ------------+------------+---------+-------------------+----------------------------------------
  26. 25966 | 2019-01-04 | N | Carl Sykes | Leo Cras Vehicula Limited
  27. 921412 | 2018-12-13 | N | Brady Harrison | Nulla In Tincidunt Consulting
  28. 521367 | 2019-11-18 | Y | Aaron Norton | Pharetra Sed Hendrerit Associates
  29. 843096 | 2020-02-03 | N | Preston Leon | A Felis Limited
  30. 460162 | 2019-01-17 | N | Neville Good | Odio Aliquam Company
  31. 187360 | 2018-12-09 | Y | Emery Pittman | Arcu Ac Orci Foundation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement