12strulogs.mql 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. -- ============================================================
  2. -- bucket strulogs 测试
  3. -- ============================================================
  4. -- 1. 插入数据到 bucket strulogs
  5. insert into /test/aaa/test_bucket_strulogs (name, data, val) values ('strulog_001', 'structured log data 1', 100)
  6. /**
  7. onerror(continue)
  8. **/
  9. ;
  10. -- 2. 查询 bucket strulogs
  11. select * from /test/aaa/test_bucket_strulogs where name='strulog_001'
  12. /**
  13. onerror(continue)
  14. output()
  15. count(1)
  16. **/
  17. ;
  18. -- 3. 批量插入
  19. insert into /test/aaa/test_bucket_strulogs (name, data, val) values ('strulog_002', 'structured log data 2', 200)
  20. /**
  21. onerror(continue)
  22. **/
  23. ;
  24. insert into /test/aaa/test_bucket_strulogs (name, data, val) values ('strulog_003', 'structured log data 3', 300)
  25. /**
  26. onerror(continue)
  27. **/
  28. ;
  29. -- 4. 按值搜索 strulogs
  30. select * from /test/aaa/test_bucket_strulogs where val>150
  31. /**
  32. onerror(continue)
  33. output()
  34. **/
  35. ;
  36. -- 5. update strulogs
  37. update /test/aaa/test_bucket_strulogs set val=999 where name='strulog_001'
  38. /**
  39. onerror(continue)
  40. **/
  41. ;
  42. select name, val from /test/aaa/test_bucket_strulogs where name='strulog_001'
  43. /**
  44. onerror(continue)
  45. output()
  46. **/
  47. ;
  48. -- 6. delete strulogs
  49. delete from /test/aaa/test_bucket_strulogs where name='strulog_003'
  50. /**
  51. onerror(continue)
  52. **/
  53. ;
  54. select count(*) from /test/aaa/test_bucket_strulogs
  55. /**
  56. onerror(continue)
  57. output()
  58. **/
  59. ;