1094.subquery.mql 877 B

123456789101112131415161718192021222324252627282930313233343536
  1. -- SELECT id,prom.time('2024-01-01 09:09:09.090', '2024-01-03 19:19:19.191').find(name='test1').unit('sum','1d') FROM /test/bucketpromdb where id='bucketpromdb:wecisen1'
  2. -- /**
  3. -- output()
  4. -- matchcount(id, "bucketpromdb:wecisen1", "prom.1.2", 2880, 1)
  5. -- **/
  6. -- ;
  7. select id.count(),prom from (
  8. SELECT id,prom.time('2024-01-02 00:00:00', '2024-01-10 00:00:00').find(name='test1').unit('sum','1d') FROM /test/bucketpromdb
  9. ) group by prom
  10. /**
  11. timeout(60m)
  12. match(id, 3, prom, null)
  13. match(id, 1, "prom.0.2", 2880, "prom.7.2", 2880)
  14. **/
  15. ;
  16. select count(id),prom.avg().max().sum().count().min() from (
  17. SELECT id,prom.time('2024-01-02 00:00:00', '2024-01-10 00:00:00').find(name='test1').unit('sum','1d') FROM /test/bucketpromdb
  18. ) group by prom
  19. /**
  20. timeout(60m)
  21. output()
  22. match(count, 3, prom, null)
  23. match(count, 1, "prom.0.2", 2880, "prom.0.8", 23040, "prom.0.11", 8)
  24. **/
  25. ;