10class0.mql 2.4 KB

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