1094.subquery.aggr.mql 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. output()
  13. match(id, 3, prom, null)
  14. match(id, 1, "prom.0.2", 2880, "prom.7.2", 2880)
  15. **/
  16. ;
  17. select count(id),prom.avg().max().sum().count().min() from (
  18. 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
  19. ) group by prom
  20. /**
  21. timeout(60m)
  22. output()
  23. match(count, 3, prom, null)
  24. match(count, 1, "prom.0.2", 2880, "prom.0.8", 23040, "prom.0.11", 8)
  25. **/
  26. ;
  27. select id.count(),prom.count() from (
  28. 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
  29. ) group by prom
  30. /**
  31. timeout(60m)
  32. output()
  33. match(id, 3, "prom.0.2", 0)
  34. match(id, 1, "prom.0.2", 8)
  35. **/
  36. ;