10class0.mql 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. delete from /test/oo/car/camry with version
  2. /**
  3. onerror(continue,`not exist`,`not find`,`not found`)
  4. **/
  5. ;
  6. delete from /test/oo/Dimension with version
  7. /**
  8. onerror(continue,`not exist`,`not find`,`not found`)
  9. **/
  10. ;
  11. delete from /test/oo/wheel with version
  12. /**
  13. onerror(continue,`not exist`,`not find`,`not found`)
  14. **/
  15. ;
  16. delete from /test/oo/chair with version
  17. /**
  18. onerror(continue,`not exist`,`not find`,`not found`)
  19. **/
  20. ;
  21. delete from /test/oo/car with version
  22. /**
  23. onerror(continue,`not exist`,`not find`,`not found`)
  24. **/
  25. ;
  26. delete from /test/oo/light with version
  27. /**
  28. onerror(continue,`not exist`,`not find`,`not found`)
  29. **/
  30. ;
  31. delete from /test/oo with version
  32. /**
  33. onerror(continue,`not exist`,`not find`,`not found`)
  34. **/
  35. ;
  36. -- drop class if exists /test/oo/car/camry;
  37. -- drop class if exists /test/oo/light;
  38. -- drop class if exists /test/oo/car;
  39. -- drop class if exists /test/oo/chair;
  40. -- drop class if exists /test/oo/wheel;
  41. -- drop class if exists /test/oo/Dimension;
  42. -- drop class if exists /test/oo;
  43. create class if not exists /test() with namespace="test"
  44. ;
  45. create class if not exists /test/oo();
  46. create class if not exists Dimension : /test/oo (
  47. llength int,
  48. wwidth int,
  49. bk2 bucket {
  50. "type" : "tsdb",
  51. "param" : ["iparam1","iparam2","fparam1","fparam2","sparam1","vparam1"],
  52. "ptype" : ["i","i","f","f","s","s"],
  53. "unit" : ["%","m","ms","ns","",""],
  54. "precision":[0,0,3,4,0,0],
  55. "ttl" : 365,
  56. "crc" : ["iparam1", "sparam1"]
  57. } 'full',
  58. indexes(llength, wwidth)
  59. ) with key=manu ;
  60. create class if not exists Chair : /test/oo (
  61. llength int,
  62. wwidth int,
  63. indexes(llength, wwidth)
  64. ) with key=manu ;
  65. create class if not exists Light : /test/oo (
  66. lnum int,
  67. indexes(lnum)
  68. ) with key=manu ;
  69. create class if not exists Wheel : /test/oo (
  70. dim Dimension,
  71. mymorph Morph<Chair, Light>[2],
  72. remark varchar,
  73. indexes(remark)
  74. ) with key=manu ;
  75. create class if not exists Car : /test/oo (
  76. wheel Wheel[4..4],
  77. remark varchar,
  78. indexes(remark)
  79. ) with key=manu ;
  80. create class if not exists Camry : Car () with key=manu ;
  81. alter class /test/oo/car add column bk2 bucket {
  82. "type" : "tsdb",
  83. "param" : ["iparam1","iparam2","fparam1","fparam2","sparam1","vparam1"],
  84. "ptype" : ["i","i","f","f","s","s"],
  85. "unit" : ["%","m","ms","ns","",""],
  86. "precision":[0,0,3,4,0,0],
  87. "ttl" : 365,
  88. "crc" : ["iparam1", "sparam1"]
  89. } 'full',
  90. wwheel Wheel[4..4] "hhh"
  91. /**
  92. onerror(continue) rem('列已存在是正常的,需要增加相应错误信息')
  93. **/
  94. ;