Advertisement
Guest User

Untitled

a guest
Jan 13th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. CREATE TABLE metricresultindexed4(metric text, timeunit text, periodenddtm timestamp, periodlabel text, tagsstr text, tags set<text>, value double, status text, message text, PRIMARY KEY((metric,timeunit), periodenddtm, tagsstr));
  2. CREATE INDEX metricresultindexedtags4 ON testresult.metricresultindexed4 (tags);
  3.  
  4. INSERT INTO testresult.metricresultindexed4(metric,timeunit,periodenddtm,periodlabel, tagsstr, tags, value, status, message) VALUES('Sales', 'Month', 1357064999000, 'Jan-10', 'U.S.A|Pen', {'U.S.A', 'Pencil'}, 50, 'success', 'success');
  5.  
  6. select * from metricresultindexed4 where metric='Sales' AND timeunit='Month' AND periodenddtm=1362076199000 AND tags CONTAINS 'U.S.A';
  7.  
  8. /* Getting 0 rows here */
  9.  
  10. INSERT INTO testresult.metricresultindexed4(metric,timeunit,periodenddtm,periodlabel, tagsstr, value, status, message) VALUES('Sales', 'Month', 1357064999000, 'Jan-10', 'U.S.A|Pen', 60, 'success', 'success');
  11. UPDATE testresult.metricresultindexed4 SET tags={'U.S.A', 'Pen'} where metric='Sales' AND timeunit='Month' AND periodenddtm=1362076199000 AND tagsstr='U.S.A|Pen';
  12.  
  13. select * from metricresultindexed4 where metric='Sales' AND timeunit='Month' AND periodenddtm=1362076199000 AND tags CONTAINS 'U.S.A';
  14.  
  15. /* Getting 0 rows here */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement