cluster.slt 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. # Basic tests of the `CREATE CLUSTER` and `DROP CLUSTER` DDL statements.
  10. mode cockroach
  11. # Start from a pristine state
  12. reset-server
  13. simple conn=mz_system,user=mz_system
  14. ALTER SYSTEM SET unsafe_enable_unorchestrated_cluster_replicas = on;
  15. ----
  16. COMPLETE 0
  17. statement error db error: ERROR: Expected one of AVAILABILITY or DISK or INTROSPECTION or MANAGED or REPLICAS or REPLICATION or SIZE or SCHEDULE or WORKLOAD, found EOF
  18. CREATE CLUSTER foo
  19. statement ok
  20. CREATE CLUSTER foo REPLICAS ()
  21. statement error db error: ERROR: Expected one of OWNER or RENAME or RESET or SET or SWAP, found dot
  22. ALTER CLUSTER foo.bar RENAME TO bar
  23. statement ok
  24. ALTER CLUSTER foo RENAME TO bar
  25. statement error unknown cluster 'foo'
  26. ALTER CLUSTER foo RENAME TO bar
  27. simple conn=mz_system,user=mz_system
  28. ALTER SYSTEM SET enable_rbac_checks TO false;
  29. ----
  30. COMPLETE 0
  31. statement error db error: ERROR: must be owner of CLUSTER mz_catalog_server
  32. ALTER CLUSTER mz_catalog_server RENAME TO foo
  33. simple conn=mz_system,user=mz_system
  34. ALTER SYSTEM RESET enable_rbac_checks;
  35. ----
  36. COMPLETE 0
  37. statement ok
  38. ALTER CLUSTER IF EXISTS bar RENAME TO foo
  39. statement ok
  40. ALTER CLUSTER IF EXISTS bar RENAME TO foo
  41. statement ok
  42. CREATE CLUSTER bar REPLICAS ()
  43. statement error uniqueness violation
  44. ALTER CLUSTER foo RENAME TO bar
  45. statement ok
  46. DROP CLUSTER foo
  47. statement ok
  48. DROP CLUSTER bar
  49. statement error REPLICAS specified more than once
  50. CREATE CLUSTER foo REPLICAS (), REPLICAS()
  51. # Creating cluster w/ remote replica works.
  52. statement ok
  53. CREATE CLUSTER foo REPLICAS (r1 (STORAGECTL ADDRESSES ['s:1234'], STORAGE ADDRESSES ['st:1235'], COMPUTECTL ADDRESSES ['c:1234'], COMPUTE ADDRESSES ['ct:1235']))
  54. statement error cluster 'foo' already exists
  55. CREATE CLUSTER foo REPLICAS (r1 (SIZE '1'))
  56. statement error cannot create multiple replicas named 'r1' on cluster 'bar'
  57. CREATE CLUSTER bar REPLICAS (r1 (SIZE '1'), r1 (SIZE '1'))
  58. statement error COMPUTE ADDRESSES specified more than once
  59. CREATE CLUSTER bar REPLICAS (r1 (COMPUTE ADDRESSES ['localhost:1235'], COMPUTE ADDRESSES ['localhost:1234']))
  60. statement ok
  61. CREATE CLUSTER bar REPLICAS (r1 (SIZE '1'), r2 (SIZE '1'))
  62. query TT rowsort
  63. SELECT id, name FROM mz_clusters
  64. ----
  65. s1 mz_system
  66. s2 mz_catalog_server
  67. s3 mz_probe
  68. s4 mz_support
  69. s5 mz_analytics
  70. u1 quickstart
  71. u4 foo
  72. u7 bar
  73. query T rowsort
  74. SELECT name FROM (SHOW CLUSTERS LIKE 'q%')
  75. ----
  76. quickstart
  77. # Test invalid option combinations.
  78. statement error invalid mixture of orchestrated and unorchestrated replica options
  79. CREATE CLUSTER baz REPLICAS (r1 (COMPUTE ADDRESSES ['localhost:1234'], SIZE 'small'))
  80. statement error invalid mixture of orchestrated and unorchestrated replica options
  81. CREATE CLUSTER baz REPLICAS (r1 (SIZE '2', WORKERS 1))
  82. statement error invalid mixture of orchestrated and unorchestrated replica options
  83. CREATE CLUSTER baz REPLICAS (r1 (SIZE '2', COMPUTE ADDRESSES ['localhost:1234']))
  84. statement error COMPUTECTL ADDRESSES and COMPUTE ADDRESSES must have the same length
  85. CREATE CLUSTER baz REPLICAS (r1 (STORAGECTL ADDRESSES ['localhost:1234'], STORAGE ADDRESSES ['localhost:1234'], COMPUTECTL ADDRESSES ['localhost:1234', 'localhost:4567'], COMPUTE ADDRESSES [], WORKERS 1))
  86. statement error STORAGECTL ADDRESSES and STORAGE ADDRESSES must have the same length
  87. CREATE CLUSTER baz REPLICAS (r1 (STORAGECTL ADDRESSES ['localhost:1234'], STORAGE ADDRESSES ['localhost:1234', 'localhost:4567'], COMPUTECTL ADDRESSES ['localhost:1234'], COMPUTE ADDRESSES ['localhost:1234'], WORKERS 1))
  88. statement error COMPUTECTL ADDRESSES and STORAGECTL ADDRESSES must have the same length
  89. CREATE CLUSTER baz REPLICAS (r1 (STORAGECTL ADDRESSES ['localhost:1234'], STORAGE ADDRESSES ['localhost:1234'], COMPUTECTL ADDRESSES [], COMPUTE ADDRESSES [], WORKERS 1))
  90. statement error COMPUTECTL ADDRESSES and COMPUTE ADDRESSES must have the same length
  91. CREATE CLUSTER baz REPLICAS (r1 (STORAGECTL ADDRESSES ['localhost:1234'], STORAGE ADDRESSES ['localhost:1234'], COMPUTECTL ADDRESSES [], COMPUTE ADDRESSES ['localhost:1234', 'localhost:4567'], WORKERS 1))
  92. statement error WORKERS must be greater than 0
  93. CREATE CLUSTER baz REPLICAS (r1 (STORAGECTL ADDRESSES ['s:1234'], STORAGE ADDRESSES ['st:1234'], COMPUTECTL ADDRESSES ['c:1234'], COMPUTE ADDRESSES ['t:1235'], WORKERS 0))
  94. # Test `cluster` session variable.
  95. query T
  96. SHOW cluster
  97. ----
  98. quickstart
  99. statement ok
  100. SET cluster = 'bar'
  101. query T
  102. SHOW cluster
  103. ----
  104. bar
  105. statement ok
  106. CREATE VIEW v AS SELECT 1
  107. statement ok
  108. CREATE DEFAULT INDEX ON v
  109. statement ok
  110. SET cluster = 'quickstart'
  111. query T
  112. SELECT * FROM v
  113. ----
  114. 1
  115. query TTTTT
  116. SHOW INDEXES ON v IN CLUSTER bar;
  117. ----
  118. v_primary_idx v bar {?column?} (empty)
  119. statement ok
  120. CREATE DEFAULT INDEX foo_v_idx IN CLUSTER foo ON v
  121. query TTTTT
  122. SHOW INDEXES IN CLUSTER bar WHERE name NOT LIKE 'mz_%';
  123. ----
  124. v_primary_idx v bar {?column?} (empty)
  125. query TTTTTTT
  126. SELECT
  127. clusters.name AS cluster,
  128. objs.name AS on_name,
  129. idxs.name AS key_name,
  130. idx_cols.index_position AS seq_in_index,
  131. obj_cols.name AS column_name,
  132. idx_cols.on_expression AS expression,
  133. idx_cols.nullable AS nullable
  134. FROM
  135. mz_catalog.mz_indexes AS idxs
  136. JOIN mz_catalog.mz_index_columns AS idx_cols ON idxs.id = idx_cols.index_id
  137. JOIN mz_catalog.mz_objects AS objs ON idxs.on_id = objs.id
  138. JOIN mz_catalog.mz_clusters AS clusters ON clusters.id = idxs.cluster_id
  139. LEFT JOIN mz_catalog.mz_columns AS obj_cols
  140. ON idxs.on_id = obj_cols.id AND idx_cols.on_position = obj_cols.position
  141. WHERE clusters.name = 'bar'
  142. ORDER BY on_name, seq_in_index ASC;
  143. ----
  144. bar mz_active_peeks_per_worker mz_active_peeks_per_worker_u7_primary_idx 1 id NULL false
  145. bar mz_active_peeks_per_worker mz_active_peeks_per_worker_u7_primary_idx 2 worker_id NULL false
  146. bar mz_arrangement_batcher_allocations_raw mz_arrangement_batcher_allocations_raw_u7_primary_idx 1 operator_id NULL false
  147. bar mz_arrangement_batcher_allocations_raw mz_arrangement_batcher_allocations_raw_u7_primary_idx 2 worker_id NULL false
  148. bar mz_arrangement_batcher_capacity_raw mz_arrangement_batcher_capacity_raw_u7_primary_idx 1 operator_id NULL false
  149. bar mz_arrangement_batcher_capacity_raw mz_arrangement_batcher_capacity_raw_u7_primary_idx 2 worker_id NULL false
  150. bar mz_arrangement_batcher_records_raw mz_arrangement_batcher_records_raw_u7_primary_idx 1 operator_id NULL false
  151. bar mz_arrangement_batcher_records_raw mz_arrangement_batcher_records_raw_u7_primary_idx 2 worker_id NULL false
  152. bar mz_arrangement_batcher_size_raw mz_arrangement_batcher_size_raw_u7_primary_idx 1 operator_id NULL false
  153. bar mz_arrangement_batcher_size_raw mz_arrangement_batcher_size_raw_u7_primary_idx 2 worker_id NULL false
  154. bar mz_arrangement_batches_raw mz_arrangement_batches_raw_u7_primary_idx 1 operator_id NULL false
  155. bar mz_arrangement_batches_raw mz_arrangement_batches_raw_u7_primary_idx 2 worker_id NULL false
  156. bar mz_arrangement_heap_allocations_raw mz_arrangement_heap_allocations_raw_u7_primary_idx 1 operator_id NULL false
  157. bar mz_arrangement_heap_allocations_raw mz_arrangement_heap_allocations_raw_u7_primary_idx 2 worker_id NULL false
  158. bar mz_arrangement_heap_capacity_raw mz_arrangement_heap_capacity_raw_u7_primary_idx 1 operator_id NULL false
  159. bar mz_arrangement_heap_capacity_raw mz_arrangement_heap_capacity_raw_u7_primary_idx 2 worker_id NULL false
  160. bar mz_arrangement_heap_size_raw mz_arrangement_heap_size_raw_u7_primary_idx 1 operator_id NULL false
  161. bar mz_arrangement_heap_size_raw mz_arrangement_heap_size_raw_u7_primary_idx 2 worker_id NULL false
  162. bar mz_arrangement_records_raw mz_arrangement_records_raw_u7_primary_idx 1 operator_id NULL false
  163. bar mz_arrangement_records_raw mz_arrangement_records_raw_u7_primary_idx 2 worker_id NULL false
  164. bar mz_arrangement_sharing_raw mz_arrangement_sharing_raw_u7_primary_idx 1 operator_id NULL false
  165. bar mz_arrangement_sharing_raw mz_arrangement_sharing_raw_u7_primary_idx 2 worker_id NULL false
  166. bar mz_compute_dataflow_global_ids_per_worker mz_compute_dataflow_global_ids_per_worker_u7_primary_idx 1 id NULL false
  167. bar mz_compute_dataflow_global_ids_per_worker mz_compute_dataflow_global_ids_per_worker_u7_primary_idx 2 worker_id NULL false
  168. bar mz_compute_error_counts_raw mz_compute_error_counts_raw_u7_primary_idx 1 export_id NULL false
  169. bar mz_compute_error_counts_raw mz_compute_error_counts_raw_u7_primary_idx 2 worker_id NULL false
  170. bar mz_compute_exports_per_worker mz_compute_exports_per_worker_u7_primary_idx 1 export_id NULL false
  171. bar mz_compute_exports_per_worker mz_compute_exports_per_worker_u7_primary_idx 2 worker_id NULL false
  172. bar mz_compute_frontiers_per_worker mz_compute_frontiers_per_worker_u7_primary_idx 1 export_id NULL false
  173. bar mz_compute_frontiers_per_worker mz_compute_frontiers_per_worker_u7_primary_idx 2 worker_id NULL false
  174. bar mz_compute_hydration_times_per_worker mz_compute_hydration_times_per_worker_u7_primary_idx 1 export_id NULL false
  175. bar mz_compute_hydration_times_per_worker mz_compute_hydration_times_per_worker_u7_primary_idx 2 worker_id NULL false
  176. bar mz_compute_import_frontiers_per_worker mz_compute_import_frontiers_per_worker_u7_primary_idx 1 export_id NULL false
  177. bar mz_compute_import_frontiers_per_worker mz_compute_import_frontiers_per_worker_u7_primary_idx 2 import_id NULL false
  178. bar mz_compute_import_frontiers_per_worker mz_compute_import_frontiers_per_worker_u7_primary_idx 3 worker_id NULL false
  179. bar mz_compute_lir_mapping_per_worker mz_compute_lir_mapping_per_worker_u7_primary_idx 1 global_id NULL false
  180. bar mz_compute_lir_mapping_per_worker mz_compute_lir_mapping_per_worker_u7_primary_idx 2 lir_id NULL false
  181. bar mz_compute_lir_mapping_per_worker mz_compute_lir_mapping_per_worker_u7_primary_idx 3 worker_id NULL false
  182. bar mz_compute_operator_durations_histogram_raw mz_compute_operator_durations_histogram_raw_u7_primary_idx 1 id NULL false
  183. bar mz_compute_operator_durations_histogram_raw mz_compute_operator_durations_histogram_raw_u7_primary_idx 2 worker_id NULL false
  184. bar mz_compute_operator_durations_histogram_raw mz_compute_operator_durations_histogram_raw_u7_primary_idx 3 duration_ns NULL false
  185. bar mz_dataflow_addresses_per_worker mz_dataflow_addresses_per_worker_u7_primary_idx 1 id NULL false
  186. bar mz_dataflow_addresses_per_worker mz_dataflow_addresses_per_worker_u7_primary_idx 2 worker_id NULL false
  187. bar mz_dataflow_channels_per_worker mz_dataflow_channels_per_worker_u7_primary_idx 1 id NULL false
  188. bar mz_dataflow_channels_per_worker mz_dataflow_channels_per_worker_u7_primary_idx 2 worker_id NULL false
  189. bar mz_dataflow_operator_reachability_raw mz_dataflow_operator_reachability_raw_u7_primary_idx 1 id NULL false
  190. bar mz_dataflow_operator_reachability_raw mz_dataflow_operator_reachability_raw_u7_primary_idx 2 worker_id NULL false
  191. bar mz_dataflow_operator_reachability_raw mz_dataflow_operator_reachability_raw_u7_primary_idx 3 source NULL false
  192. bar mz_dataflow_operator_reachability_raw mz_dataflow_operator_reachability_raw_u7_primary_idx 4 port NULL false
  193. bar mz_dataflow_operator_reachability_raw mz_dataflow_operator_reachability_raw_u7_primary_idx 5 update_type NULL false
  194. bar mz_dataflow_operator_reachability_raw mz_dataflow_operator_reachability_raw_u7_primary_idx 6 time NULL true
  195. bar mz_dataflow_operators_per_worker mz_dataflow_operators_per_worker_u7_primary_idx 1 id NULL false
  196. bar mz_dataflow_operators_per_worker mz_dataflow_operators_per_worker_u7_primary_idx 2 worker_id NULL false
  197. bar mz_dataflow_shutdown_durations_histogram_raw mz_dataflow_shutdown_durations_histogram_raw_u7_primary_idx 1 worker_id NULL false
  198. bar mz_dataflow_shutdown_durations_histogram_raw mz_dataflow_shutdown_durations_histogram_raw_u7_primary_idx 2 duration_ns NULL false
  199. bar mz_message_batch_counts_received_raw mz_message_batch_counts_received_raw_u7_primary_idx 1 channel_id NULL false
  200. bar mz_message_batch_counts_received_raw mz_message_batch_counts_received_raw_u7_primary_idx 2 from_worker_id NULL false
  201. bar mz_message_batch_counts_received_raw mz_message_batch_counts_received_raw_u7_primary_idx 3 to_worker_id NULL false
  202. bar mz_message_batch_counts_sent_raw mz_message_batch_counts_sent_raw_u7_primary_idx 1 channel_id NULL false
  203. bar mz_message_batch_counts_sent_raw mz_message_batch_counts_sent_raw_u7_primary_idx 2 from_worker_id NULL false
  204. bar mz_message_batch_counts_sent_raw mz_message_batch_counts_sent_raw_u7_primary_idx 3 to_worker_id NULL false
  205. bar mz_message_counts_received_raw mz_message_counts_received_raw_u7_primary_idx 1 channel_id NULL false
  206. bar mz_message_counts_received_raw mz_message_counts_received_raw_u7_primary_idx 2 from_worker_id NULL false
  207. bar mz_message_counts_received_raw mz_message_counts_received_raw_u7_primary_idx 3 to_worker_id NULL false
  208. bar mz_message_counts_sent_raw mz_message_counts_sent_raw_u7_primary_idx 1 channel_id NULL false
  209. bar mz_message_counts_sent_raw mz_message_counts_sent_raw_u7_primary_idx 2 from_worker_id NULL false
  210. bar mz_message_counts_sent_raw mz_message_counts_sent_raw_u7_primary_idx 3 to_worker_id NULL false
  211. bar mz_peek_durations_histogram_raw mz_peek_durations_histogram_raw_u7_primary_idx 1 worker_id NULL false
  212. bar mz_peek_durations_histogram_raw mz_peek_durations_histogram_raw_u7_primary_idx 2 type NULL false
  213. bar mz_peek_durations_histogram_raw mz_peek_durations_histogram_raw_u7_primary_idx 3 duration_ns NULL false
  214. bar mz_scheduling_elapsed_raw mz_scheduling_elapsed_raw_u7_primary_idx 1 id NULL false
  215. bar mz_scheduling_elapsed_raw mz_scheduling_elapsed_raw_u7_primary_idx 2 worker_id NULL false
  216. bar mz_scheduling_parks_histogram_raw mz_scheduling_parks_histogram_raw_u7_primary_idx 1 worker_id NULL false
  217. bar mz_scheduling_parks_histogram_raw mz_scheduling_parks_histogram_raw_u7_primary_idx 2 slept_for_ns NULL false
  218. bar mz_scheduling_parks_histogram_raw mz_scheduling_parks_histogram_raw_u7_primary_idx 3 requested_ns NULL false
  219. bar v v_primary_idx 1 ?column? NULL false
  220. query TTTTT
  221. SHOW INDEXES;
  222. ----
  223. foo_v_idx v foo {?column?} (empty)
  224. v_primary_idx v bar {?column?} (empty)
  225. query T
  226. SELECT
  227. mz_clusters.name
  228. FROM
  229. mz_clusters JOIN mz_indexes ON mz_clusters.id = mz_indexes.cluster_id
  230. WHERE
  231. mz_indexes.name = 'v_primary_idx';
  232. ----
  233. bar
  234. # Test invalid setting of `cluster`.
  235. # It's okay to set the `cluster` variable to an invalid cluster.
  236. statement ok
  237. SET cluster = 'bad'
  238. # But you can't do any reads on that cluster.
  239. statement error unknown cluster 'bad'
  240. SELECT * FROM v
  241. # Nor can you create indexes on that cluster.
  242. statement error unknown cluster 'bad'
  243. CREATE MATERIALIZED VIEW v2 AS SELECT 1
  244. # But you can create unmaterialized views on that cluster.
  245. statement ok
  246. CREATE VIEW unmat AS SELECT 1
  247. # Test `CREATE INDEX ... IN CLUSTER`.
  248. statement ok
  249. SET cluster = 'quickstart'
  250. query T
  251. SELECT name FROM mz_indexes WHERE name NOT LIKE 'mz_%' AND name NOT LIKE 'pg_%';
  252. ----
  253. foo_v_idx
  254. v_primary_idx
  255. statement ok
  256. CREATE DEFAULT INDEX IN CLUSTER bar ON v
  257. query TTTTT
  258. SHOW INDEXES ON v IN CLUSTER bar;
  259. ----
  260. v_primary_idx v bar {?column?} (empty)
  261. v_primary_idx1 v bar {?column?} (empty)
  262. statement error unknown cluster 'noexist'
  263. CREATE DEFAULT INDEX IN CLUSTER noexist ON v
  264. # Test invalid DROPs.
  265. query T
  266. SHOW cluster
  267. ----
  268. quickstart
  269. statement error unknown cluster 'baz'
  270. DROP CLUSTER baz
  271. statement error cannot drop cluster "bar" because other objects depend on it
  272. DROP CLUSTER bar
  273. query TTTTT
  274. SHOW INDEXES IN CLUSTER bar WHERE on = 'v';
  275. ----
  276. v_primary_idx v bar {?column?} (empty)
  277. v_primary_idx1 v bar {?column?} (empty)
  278. statement ok
  279. DROP INDEX v_primary_idx
  280. statement ok
  281. DROP INDEX v_primary_idx1
  282. # Test valid DROPs
  283. statement ok
  284. DROP CLUSTER bar
  285. statement ok
  286. DROP CLUSTER foo CASCADE
  287. statement ok
  288. CREATE CLUSTER baz REPLICAS (r1 (SIZE '1'))
  289. statement ok
  290. CREATE DEFAULT INDEX IN CLUSTER baz ON v
  291. statement error cannot drop cluster "baz" because other objects depend on it
  292. DROP CLUSTER baz
  293. statement ok
  294. DROP CLUSTER baz CASCADE
  295. query T
  296. SELECT name FROM mz_indexes WHERE name NOT LIKE 'mz_%' AND name NOT LIKE 'pg_%';
  297. ----
  298. # Test that dropping a cluster and re-creating it with the same name is valid if introspection sources are enabled
  299. statement ok
  300. CREATE CLUSTER foo REPLICAS (r1 (SIZE '1', INTROSPECTION INTERVAL '1s'))
  301. statement ok
  302. DROP CLUSTER foo CASCADE
  303. statement ok
  304. CREATE CLUSTER foo REPLICAS (r1 (SIZE '1', INTROSPECTION INTERVAL '1s'))
  305. statement ok
  306. DROP CLUSTER foo CASCADE
  307. # Test that bad cluster sizes don't cause a crash
  308. statement error unknown cluster replica size
  309. CREATE CLUSTER foo REPLICAS (a (SIZE 'lol'))
  310. statement ok
  311. CREATE CLUSTER foo REPLICAS (a (SIZE '1'))
  312. statement ok
  313. CREATE CLUSTER foo2 REPLICAS (a (SIZE '32'))
  314. statement ok
  315. CREATE CLUSTER foo3 REPLICAS (a (SIZE '2-2'))
  316. # Ensure that identifiers are correctly handled in value position, even when
  317. # they can't be printed bare. We previously had a bug where `"1"` was
  318. # incorrectly parsed as size `"1"` (quotes included), but `"small"` was parsed
  319. # as size `small` (quotes excluded).
  320. statement ok
  321. CREATE CLUSTER foo4 REPLICAS (a (SIZE "1"))
  322. statement ok
  323. DROP CLUSTER foo, foo2, foo3, foo4 CASCADE
  324. # Test that introspection source indexes are created and dropped correctly
  325. query I
  326. SELECT COUNT(name) FROM mz_indexes WHERE cluster_id = 'u1';
  327. ----
  328. 31
  329. query I
  330. SELECT COUNT(name) FROM mz_indexes WHERE cluster_id <> 'u1' AND cluster_id NOT LIKE 's%';
  331. ----
  332. 0
  333. statement ok
  334. CREATE CLUSTER test REPLICAS (foo (SIZE '1'));
  335. query I
  336. SELECT COUNT(name) FROM mz_indexes;
  337. ----
  338. 288
  339. statement ok
  340. DROP CLUSTER test CASCADE
  341. query T
  342. SELECT COUNT(name) FROM mz_indexes;
  343. ----
  344. 257
  345. simple conn=mz_system,user=mz_system
  346. ALTER CLUSTER quickstart OWNER TO materialize
  347. ----
  348. COMPLETE 0
  349. statement ok
  350. DROP CLUSTER quickstart;
  351. statement ok
  352. CREATE CLUSTER quickstart REPLICAS (r1 (SIZE '2')), MANAGED = false;
  353. statement error invalid SIZE: must provide a string value
  354. CREATE CLUSTER REPLICA quickstart.size_1 SIZE;
  355. statement ok
  356. CREATE CLUSTER REPLICA quickstart.size_1 SIZE '1';
  357. query TTT
  358. SELECT cluster, replica, size FROM (SHOW CLUSTER REPLICAS) ORDER BY 1, 2, 3
  359. ----
  360. mz_catalog_server r1 2
  361. mz_probe r1 2
  362. mz_system r1 2
  363. quickstart r1 2
  364. quickstart size_1 1
  365. statement ok
  366. CREATE CLUSTER foo REPLICAS (size_1 (SIZE '1'), size_2 (SIZE '2'))
  367. query TTT
  368. SELECT cluster, replica, size FROM (SHOW CLUSTER REPLICAS) ORDER BY 1, 2, 3
  369. ----
  370. foo size_1 1
  371. foo size_2 2
  372. mz_catalog_server r1 2
  373. mz_probe r1 2
  374. mz_system r1 2
  375. quickstart r1 2
  376. quickstart size_1 1
  377. statement ok
  378. DROP CLUSTER REPLICA IF EXISTS quickstart.bar
  379. statement ok
  380. DROP CLUSTER REPLICA IF EXISTS bar.foo
  381. statement ok
  382. DROP CLUSTER REPLICA IF EXISTS quickstart.foo
  383. query error CLUSTER foo has no CLUSTER REPLICA named "foo"
  384. DROP CLUSTER REPLICA quickstart.size_1, foo.foo
  385. statement ok
  386. DROP CLUSTER REPLICA quickstart.size_1
  387. statement ok
  388. DROP CLUSTER REPLICA foo.size_1, foo.size_2
  389. query TTT
  390. SELECT cluster, replica, size FROM (SHOW CLUSTER REPLICAS) ORDER BY 1, 2, 3
  391. ----
  392. mz_catalog_server r1 2
  393. mz_probe r1 2
  394. mz_system r1 2
  395. quickstart r1 2
  396. statement ok
  397. CREATE CLUSTER REPLICA quickstart.foo_bar SIZE '1'
  398. statement error db error: ERROR: Expected dot, found RENAME
  399. ALTER CLUSTER REPLICA quickstart RENAME TO bar_foo
  400. statement ok
  401. ALTER CLUSTER REPLICA quickstart.foo_bar RENAME TO bar_foo
  402. statement error CLUSTER quickstart has no CLUSTER REPLICA named "foo_bar"
  403. ALTER CLUSTER REPLICA quickstart.foo_bar RENAME TO bar_foo
  404. statement ok
  405. ALTER CLUSTER REPLICA IF EXISTS quickstart.bar_foo RENAME TO foo_bar
  406. statement ok
  407. ALTER CLUSTER REPLICA IF EXISTS quickstart.bar_foo RENAME TO foo_bar
  408. statement ok
  409. CREATE CLUSTER REPLICA quickstart.bar_foo SIZE '1'
  410. statement error uniqueness violation
  411. ALTER CLUSTER REPLICA quickstart.bar_foo RENAME TO foo_bar
  412. statement ok
  413. DROP CLUSTER REPLICA quickstart.foo_bar
  414. statement ok
  415. DROP CLUSTER REPLICA quickstart.bar_foo
  416. statement ok
  417. CREATE CLUSTER REPLICA quickstart."foo-bar" SIZE '1'
  418. statement ok
  419. DROP CLUSTER REPLICA quickstart."foo-bar"
  420. statement ok
  421. CREATE CLUSTER "foo-bar" REPLICAS ()
  422. statement ok
  423. CREATE CLUSTER REPLICA "foo-bar"."foo-bar" SIZE '1'
  424. statement ok
  425. DROP CLUSTER REPLICA "foo-bar"."foo-bar"
  426. statement ok
  427. DROP CLUSTER "foo-bar"
  428. statement ok
  429. CREATE CLUSTER REPLICA quickstart."好-好" SIZE '1'
  430. statement ok
  431. DROP CLUSTER REPLICA quickstart."好-好"
  432. statement ok
  433. CREATE CLUSTER REPLICA quickstart."好_好" SIZE '1'
  434. statement ok
  435. DROP CLUSTER REPLICA quickstart."好_好"
  436. # clusters wo replicas cannot service selects
  437. statement ok
  438. CREATE CLUSTER empty REPLICAS ()
  439. statement ok
  440. SET cluster = empty
  441. simple
  442. SELECT generate_series(1, 1)
  443. ----
  444. db error: ERROR: CLUSTER "empty" has no replicas available to service request
  445. HINT: Use CREATE CLUSTER REPLICA to attach cluster replicas to the cluster
  446. statement ok
  447. DROP CLUSTER empty
  448. statement ok
  449. CREATE CLUSTER empty (SIZE '1', REPLICATION FACTOR 0)
  450. simple
  451. SELECT generate_series(1, 1)
  452. ----
  453. db error: ERROR: CLUSTER "empty" has no replicas available to service request
  454. HINT: Use ALTER CLUSTER to adjust the replication factor of the cluster. Example:`ALTER CLUSTER <cluster-name> SET (REPLICATION FACTOR 1)`
  455. simple
  456. SUBSCRIBE (SELECT generate_series(1, 1))
  457. ----
  458. db error: ERROR: CLUSTER "empty" has no replicas available to service request
  459. HINT: Use ALTER CLUSTER to adjust the replication factor of the cluster. Example:`ALTER CLUSTER <cluster-name> SET (REPLICATION FACTOR 1)`
  460. # Phillip's tests
  461. statement error zero-length delimited identifier
  462. CREATE CLUSTER REPLICA quickstart."" SIZE '1';
  463. statement error unknown cluster
  464. CREATE CLUSTER REPLICA no_such_cluster.size_1 SIZE '1';
  465. statement error invalid SIZE
  466. CREATE CLUSTER bad REPLICAS (size_2 (SIZE NULL));
  467. statement error unknown cluster replica size
  468. CREATE CLUSTER bad REPLICAS (size_2 (SIZE ''));
  469. statement error unknown cluster replica size
  470. CREATE CLUSTER bad REPLICAS (size_2 (SIZE 'no_such_size'));
  471. statement error invalid SIZE
  472. CREATE CLUSTER bad REPLICAS (size_2 (SIZE 1));
  473. statement error unknown cluster replica size a
  474. CREATE CLUSTER bad REPLICAS (size_2 (SIZE a));
  475. statement ok
  476. DROP CLUSTER foo CASCADE;
  477. statement ok
  478. CREATE CLUSTER foo REPLICAS (size_2 (SIZE '1'));
  479. statement ok
  480. SET cluster=foo
  481. statement ok
  482. CREATE TABLE t1 (f1 INTEGER);
  483. statement ok
  484. INSERT INTO t1 VALUES (1);
  485. query I
  486. SELECT * FROM t1;
  487. ----
  488. 1
  489. statement error unknown cluster
  490. DROP CLUSTER REPLICA no_such_cluster.bar
  491. statement ok
  492. RESET cluster
  493. statement ok
  494. DROP CLUSTER foo CASCADE
  495. # Availability zones
  496. # Note that we don't support availability zones configured with slt, so they
  497. # can't be meaningfully specified
  498. statement error unknown cluster replica availability zone a
  499. CREATE CLUSTER REPLICA quickstart.replica SIZE '1', AVAILABILITY ZONE 'a'
  500. statement error AVAILABILITY ZONE specified more than once
  501. CREATE CLUSTER REPLICA quickstart.replica AVAILABILITY ZONE 'a', AVAILABILITY ZONE 'b'
  502. statement error invalid mixture of orchestrated and unorchestrated replica options
  503. CREATE CLUSTER REPLICA quickstart.replica STORAGECTL ADDRESSES ['host'], AVAILABILITY ZONE 'a'
  504. statement error invalid mixture of orchestrated and unorchestrated replica options
  505. CREATE CLUSTER REPLICA quickstart.replica STORAGECTL ADDRESSES ['host'], AVAILABILITY ZONE 'a'
  506. statement error invalid mixture of orchestrated and unorchestrated replica options
  507. CREATE CLUSTER REPLICA quickstart.replica AVAILABILITY ZONE 'a', STORAGECTL ADDRESSES ['host']
  508. # Test that the contents of mz_cluster_replicas look sensible
  509. statement ok
  510. CREATE CLUSTER foo REPLICAS (size_1 (SIZE '1'), size_32 (SIZE '32'), size_2_2 (SIZE '2-2'), size_1_8g (SIZE '1-8G'))
  511. query TTTTTTT
  512. SELECT r.name, r.size, s.processes, s.cpu_nano_cores, s.memory_bytes, s.workers, s.credits_per_hour FROM mz_cluster_replicas r JOIN mz_catalog.mz_cluster_replica_sizes s ON r.size = s.size ORDER BY r.name
  513. ----
  514. r1 2 1 18446744073709000000 18446744073709551615 2 1
  515. r1 2 1 18446744073709000000 18446744073709551615 2 1
  516. r1 2 1 18446744073709000000 18446744073709551615 2 1
  517. r1 2 1 18446744073709000000 18446744073709551615 2 1
  518. size_1 1 1 18446744073709000000 18446744073709551615 1 1
  519. size_1_8g 1-8G 1 18446744073709000000 8589934592 1 1
  520. size_2_2 2-2 2 18446744073709000000 18446744073709551615 2 2
  521. size_32 32 1 18446744073709000000 18446744073709551615 32 1
  522. statement ok
  523. DROP CLUSTER foo CASCADE
  524. # Restore pristine server state
  525. reset-server
  526. # Tests for BILLED AS replicas
  527. statement ok
  528. CREATE CLUSTER t1 SIZE '1', REPLICATION FACTOR 1
  529. simple conn=mz_system,user=mz_system
  530. CREATE CLUSTER REPLICA t1.free SIZE '2', BILLED AS 'free'
  531. ----
  532. db error: ERROR: cannot modify managed cluster t1
  533. simple conn=mz_system,user=mz_system
  534. CREATE CLUSTER REPLICA t1.r1234 SIZE '2', INTERNAL, BILLED AS 'free'
  535. ----
  536. db error: ERROR: r1234 is reserved for replicas of managed clusters
  537. simple conn=mz_system,user=mz_system
  538. CREATE CLUSTER REPLICA t1.billed SIZE '2', INTERNAL
  539. ----
  540. COMPLETE 0
  541. simple conn=mz_system,user=mz_system
  542. CREATE CLUSTER REPLICA t1.free SIZE '2', INTERNAL, BILLED AS 'free'
  543. ----
  544. COMPLETE 0
  545. statement error db error: ERROR: cannot modify managed cluster t1
  546. CREATE CLUSTER REPLICA t1.free2 SIZE '2', BILLED AS 'free'
  547. statement error db error: ERROR: cannot specify INTERNAL or BILLED AS as non\-internal user
  548. CREATE CLUSTER REPLICA t1.free2 SIZE '2', INTERNAL
  549. simple conn=mz_system,user=mz_system
  550. CREATE CLUSTER REPLICA t1.invalid SIZE '2'
  551. ----
  552. db error: ERROR: cannot modify managed cluster t1
  553. query TTTT
  554. SELECT event_type, object_type, regexp_replace(details::text, '"replica_id":"u[^"]*"', '"replica_id":"u%"'), user FROM mz_audit_events ORDER BY occurred_at DESC LIMIT 1;
  555. ----
  556. create cluster-replica {"billed_as":"free","cluster_id":"u2","cluster_name":"t1","disk":true,"internal":true,"logical_size":"2","reason":"manual","replica_id":"u%","replica_name":"free"} mz_system
  557. simple conn=mz_system,user=mz_system
  558. CREATE CLUSTER REPLICA t1.r123 SIZE '2', BILLED AS 'free'
  559. ----
  560. db error: ERROR: cannot modify managed cluster t1
  561. query TTTT rowsort
  562. SELECT name, cluster_id, size, owner_id FROM mz_cluster_replicas WHERE cluster_id = 'u2'
  563. ----
  564. free u2 2 u1
  565. billed u2 2 u1
  566. r1 u2 1 u1
  567. query T
  568. SELECT regexp_replace(id::text, 'u.*', 'u%') FROM mz_internal.mz_internal_cluster_replicas WHERE id LIKE 'u%'
  569. ----
  570. u%
  571. u%
  572. statement error db error: ERROR: cannot modify managed cluster t1
  573. CREATE CLUSTER REPLICA t1.free2 SIZE '2', BILLED AS 'free'
  574. statement ok
  575. ALTER CLUSTER t1 SET (MANAGED false);
  576. statement ok
  577. ALTER CLUSTER t1 SET (MANAGED);
  578. statement ok
  579. DROP CLUSTER REPLICA t1.free;
  580. statement error db error: ERROR: cannot drop replica of managed cluster
  581. DROP CLUSTER REPLICA t1.r1;
  582. statement ok
  583. DROP CLUSTER t1
  584. statement ok
  585. CREATE CLUSTER t1 SIZE '1'
  586. simple conn=mz_system,user=mz_system
  587. CREATE CLUSTER REPLICA t1.free SIZE '2', INTERNAL, BILLED AS 'free'
  588. ----
  589. COMPLETE 0
  590. statement ok
  591. DROP CLUSTER t1
  592. statement ok
  593. CREATE CLUSTER t1 REPLICAS (r1 (SIZE '1'))
  594. simple conn=mz_system,user=mz_system
  595. CREATE CLUSTER REPLICA t1.free SIZE '2', BILLED AS 'free', INTERNAL
  596. ----
  597. COMPLETE 0
  598. query TTTT
  599. SELECT event_type, object_type, regexp_replace(details::text, '"replica_id":"u[^"]*"', '"replica_id":"u%"'), user FROM mz_audit_events ORDER BY occurred_at DESC LIMIT 1;
  600. ----
  601. create cluster-replica {"billed_as":"free","cluster_id":"u4","cluster_name":"t1","disk":true,"internal":true,"logical_size":"2","reason":"manual","replica_id":"u%","replica_name":"free"} mz_system
  602. simple conn=mz_system,user=mz_system
  603. CREATE CLUSTER REPLICA t1.internal_r2 SIZE '2', INTERNAL
  604. ----
  605. COMPLETE 0
  606. statement ok
  607. DROP CLUSTER REPLICA t1.internal_r2
  608. simple conn=mz_system,user=mz_system
  609. CREATE CLUSTER REPLICA t1.r2 SIZE '2'
  610. ----
  611. COMPLETE 0
  612. statement ok
  613. DROP CLUSTER REPLICA t1.r2
  614. query TTTT rowsort
  615. SELECT name, cluster_id, size, owner_id FROM mz_cluster_replicas WHERE cluster_id = 'u4'
  616. ----
  617. r1 u4 1 u1
  618. free u4 2 u1
  619. simple conn=mz_system,user=mz_system
  620. CREATE CLUSTER REPLICA t1.r3 SIZE '2', BILLED AS 'free'
  621. ----
  622. db error: ERROR: must specify INTERNAL when specifying BILLED AS
  623. statement error db error: ERROR: cannot specify INTERNAL or BILLED AS as non\-internal user
  624. CREATE CLUSTER REPLICA t1.free2 SIZE '2', BILLED AS 'free'
  625. statement error db error: ERROR: cannot specify INTERNAL or BILLED AS as non\-internal user
  626. CREATE CLUSTER REPLICA t1.free2 SIZE '2', INTERNAL
  627. statement ok
  628. ALTER CLUSTER t1 SET (MANAGED);
  629. statement ok
  630. ALTER CLUSTER t1 SET (MANAGED false);
  631. statement ok
  632. DROP CLUSTER REPLICA t1.free;
  633. statement ok
  634. DROP CLUSTER REPLICA t1.r1;
  635. statement ok
  636. DROP CLUSTER t1
  637. # Test unmanaged clusters with internal/billed as.
  638. statement error db error: ERROR: cannot specify INTERNAL or BILLED AS as non\-internal user
  639. CREATE CLUSTER t1 (REPLICAS (r1 (SIZE '1', INTERNAL, BILLED AS 'free')));
  640. statement error db error: ERROR: cannot specify INTERNAL or BILLED AS as non\-internal user
  641. CREATE CLUSTER t1 (REPLICAS (internal_r1 (SIZE '1', INTERNAL, BILLED AS 'free')));
  642. statement error db error: ERROR: cannot specify INTERNAL or BILLED AS as non\-internal user
  643. CREATE CLUSTER t1 (REPLICAS (internal_r1 (SIZE '1', BILLED AS 'free')));
  644. statement error db error: ERROR: cannot specify INTERNAL or BILLED AS as non\-internal user
  645. CREATE CLUSTER t1 (REPLICAS (internal_r1 (SIZE '1', INTERNAL)));
  646. simple conn=mz_system,user=mz_system
  647. CREATE CLUSTER t1 (REPLICAS (internal_r1 (SIZE '1', BILLED AS 'free')));
  648. ----
  649. db error: ERROR: must specify INTERNAL when specifying BILLED AS
  650. simple conn=mz_system,user=mz_system
  651. CREATE CLUSTER t1 (REPLICAS (internal_r1 (SIZE '1', INTERNAL, BILLED AS 'free')));
  652. ----
  653. COMPLETE 0
  654. simple conn=mz_system,user=mz_system
  655. DROP CLUSTER t1
  656. ----
  657. COMPLETE 0
  658. # Test SHOW CREATE
  659. mode standard
  660. statement ok
  661. CREATE CLUSTER c1 (SIZE '1', REPLICATION FACTOR 2)
  662. query TT
  663. SHOW CREATE CLUSTER c1
  664. ----
  665. c1
  666. CREATE CLUSTER "c1" (DISK = true, INTROSPECTION DEBUGGING = false, INTROSPECTION INTERVAL = INTERVAL '00:00:01', MANAGED = true, REPLICATION FACTOR = 2, SIZE = '1', SCHEDULE = MANUAL)
  667. statement ok
  668. ALTER CLUSTER c1 SET (SIZE = '2');
  669. query TT
  670. SHOW CREATE CLUSTER c1
  671. ----
  672. c1
  673. CREATE CLUSTER "c1" (DISK = true, INTROSPECTION DEBUGGING = false, INTROSPECTION INTERVAL = INTERVAL '00:00:01', MANAGED = true, REPLICATION FACTOR = 2, SIZE = '2', SCHEDULE = MANUAL)
  674. statement ok
  675. DROP CLUSTER c1
  676. simple conn=mz_system,user=mz_system
  677. CREATE CLUSTER c1 SIZE = '1' FEATURES (ENABLE EAGER DELTA JOINS = TRUE);
  678. ----
  679. COMPLETE 0
  680. query TT
  681. SHOW CREATE CLUSTER c1
  682. ----
  683. c1
  684. CREATE CLUSTER "c1" (DISK = true, INTROSPECTION DEBUGGING = false, INTROSPECTION INTERVAL = INTERVAL '00:00:01', MANAGED = true, REPLICATION FACTOR = 1, SIZE = '1', SCHEDULE = MANUAL) FEATURES (ENABLE EAGER DELTA JOINS = true)
  685. simple conn=mz_system,user=mz_system
  686. DROP CLUSTER c1;
  687. ----
  688. COMPLETE 0
  689. statement ok
  690. CREATE CLUSTER c1 REPLICAS ()
  691. query error SHOW CREATE for unmanaged clusters not yet supported
  692. SHOW CREATE CLUSTER c1
  693. statement ok
  694. DROP CLUSTER c1
  695. mode cockroach
  696. reset-server
  697. # Test setting and altering WORKLOAD CLASS.
  698. query TT colnames
  699. SELECT * FROM mz_internal.mz_cluster_workload_classes
  700. ----
  701. id workload_class
  702. s1 NULL
  703. s2 NULL
  704. s3 NULL
  705. s4 NULL
  706. s5 NULL
  707. u1 NULL
  708. statement error WORKLOAD CLASS not supported for non-system users
  709. CREATE CLUSTER c1 SIZE '1', WORKLOAD CLASS 'production'
  710. simple conn=mz_system,user=mz_system
  711. CREATE CLUSTER c1 SIZE '1', WORKLOAD CLASS 'production'
  712. ----
  713. COMPLETE 0
  714. query TT colnames
  715. SELECT * FROM mz_internal.mz_cluster_workload_classes
  716. ----
  717. id workload_class
  718. s1 NULL
  719. s2 NULL
  720. s3 NULL
  721. s4 NULL
  722. s5 NULL
  723. u1 NULL
  724. u2 production
  725. simple conn=mz_system,user=mz_system
  726. DROP CLUSTER c1
  727. ----
  728. COMPLETE 0
  729. query TT colnames
  730. SELECT * FROM mz_internal.mz_cluster_workload_classes
  731. ----
  732. id workload_class
  733. s1 NULL
  734. s2 NULL
  735. s3 NULL
  736. s4 NULL
  737. s5 NULL
  738. u1 NULL
  739. statement ok
  740. CREATE CLUSTER c1 SIZE '1'
  741. query TT colnames
  742. SELECT * FROM mz_internal.mz_cluster_workload_classes
  743. ----
  744. id workload_class
  745. s1 NULL
  746. s2 NULL
  747. s3 NULL
  748. s4 NULL
  749. s5 NULL
  750. u1 NULL
  751. u3 NULL
  752. statement error WORKLOAD CLASS not supported for non-system users
  753. ALTER CLUSTER c1 RESET (WORKLOAD CLASS)
  754. statement error WORKLOAD CLASS not supported for non-system users
  755. ALTER CLUSTER c1 SET (WORKLOAD CLASS 'qa')
  756. statement error WORKLOAD CLASS not supported for non-system users
  757. ALTER CLUSTER c1 SET (WORKLOAD CLASS NULL)
  758. simple conn=mz_system,user=mz_system
  759. ALTER CLUSTER c1 RESET (WORKLOAD CLASS)
  760. ----
  761. COMPLETE 0
  762. query TT colnames
  763. SELECT * FROM mz_internal.mz_cluster_workload_classes
  764. ----
  765. id workload_class
  766. s1 NULL
  767. s2 NULL
  768. s3 NULL
  769. s4 NULL
  770. s5 NULL
  771. u1 NULL
  772. u3 NULL
  773. simple conn=mz_system,user=mz_system
  774. ALTER CLUSTER c1 SET (WORKLOAD CLASS 'qa')
  775. ----
  776. COMPLETE 0
  777. query TT colnames
  778. SELECT * FROM mz_internal.mz_cluster_workload_classes
  779. ----
  780. id workload_class
  781. s1 NULL
  782. s2 NULL
  783. s3 NULL
  784. s4 NULL
  785. s5 NULL
  786. u1 NULL
  787. u3 qa
  788. simple conn=mz_system,user=mz_system
  789. ALTER CLUSTER c1 SET (WORKLOAD CLASS NULL)
  790. ----
  791. COMPLETE 0
  792. query TT colnames
  793. SELECT * FROM mz_internal.mz_cluster_workload_classes
  794. ----
  795. id workload_class
  796. s1 NULL
  797. s2 NULL
  798. s3 NULL
  799. s4 NULL
  800. s5 NULL
  801. u1 NULL
  802. u3 NULL
  803. statement ok
  804. DROP CLUSTER c1