1094.subquery.aggr.mql 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 count(id),prom.avg().max().sum().count().min() 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. todomatch(count, 3, prom, null)
  14. match(count, 3)
  15. match(count, 1, "prom.0.2", 2880, "prom.0.8", 23040, "prom.0.11", 8)
  16. **/
  17. ;
  18. select count(id),prom from (
  19. 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
  20. ) group by prom
  21. /**
  22. timeout(60m)
  23. output()
  24. todomatch(count, 3, prom, null)
  25. match(count, 3)
  26. match(count, 1, "prom.0.2", 2880, "prom.7.2", 2880)
  27. **/
  28. ;
  29. select count(id),prom.avg().max().sum().count().min() from (
  30. 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
  31. ) group by prom
  32. /**
  33. timeout(60m)
  34. output()
  35. todomatch(id, 3, prom, null)
  36. match(count, 3)
  37. match(count, 1, "prom.0.2", 2880, "prom.0.8", 23040, "prom.0.11", 8)
  38. **/
  39. ;
  40. select count(*),count(prom) as promcount,prom.time('2024-01-03 00:00:00', '2024-01-08 00:00:00').find(name='test1').unit('sum','1d')
  41. FROM (
  42. SELECT id,prom.time('2024-01-02 00:00:00', '2024-01-10 00:00:00') FROM /test/bucketpromdb
  43. )
  44. group by prom
  45. /**
  46. timeout(60m)
  47. output()
  48. match(count,1,promcount,1,"prom.len",5)
  49. match(count,3,promcount,3,"prom.len",0)
  50. **/
  51. ;