web-console.slt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. mode cockroach
  10. # Start from a pristine server
  11. reset-server
  12. # ---- NewClusterForm.tsx
  13. statement ok
  14. CREATE CLUSTER foo REPLICAS ( r1 (SIZE = '1') );
  15. query T
  16. SELECT id FROM mz_clusters WHERE name = 'foo';
  17. ----
  18. u2
  19. statement ok
  20. DROP CLUSTER foo CASCADE;
  21. # ---- useDataflowStructure.ts
  22. statement ok
  23. CREATE TEMPORARY VIEW export_to_dataflow AS
  24. SELECT export_id, id FROM mz_introspection.mz_compute_exports AS mce JOIN mz_introspection.mz_dataflows AS md ON
  25. mce.dataflow_id = md.id;
  26. statement ok
  27. CREATE TEMPORARY VIEW all_ops AS
  28. SELECT e2d.export_id, mdod.id, mda.address, mdod.name, mdop.parent_id, coalesce(mas.records, 0) AS arrangement_records, coalesce(mse.elapsed_ns, 0) AS elapsed_ns
  29. FROM export_to_dataflow AS e2d
  30. JOIN mz_introspection.mz_dataflow_operator_dataflows AS mdod ON e2d.id = mdod.dataflow_id
  31. LEFT JOIN mz_introspection.mz_scheduling_elapsed AS mse ON mdod.id = mse.id
  32. LEFT JOIN mz_introspection.mz_arrangement_sizes AS mas ON mdod.id = mas.operator_id
  33. LEFT JOIN mz_introspection.mz_dataflow_operator_parents AS mdop ON mdod.id = mdop.id
  34. LEFT JOIN mz_introspection.mz_dataflow_addresses AS mda ON mdod.id = mda.id;
  35. # Note(parkmycar): This suceeds on web, but fails because of pg_repr using binary encoding.
  36. statement error binary encoding of list types is not implemented
  37. SELECT mdco.id, from_operator_id, from_operator_address, from_port, to_operator_id, to_operator_address, to_port, COALESCE(sum(sent), 0) AS sent
  38. FROM mz_introspection.mz_dataflow_channel_operators AS mdco
  39. JOIN mz_introspection.mz_dataflow_channels AS mdc ON mdc.id = mdco.id
  40. LEFT JOIN mz_introspection.mz_message_counts AS mmc ON mdco.id = mmc.channel_id
  41. JOIN mz_introspection.mz_compute_exports mce ON mce.dataflow_id = from_operator_address[1]
  42. WHERE mce.export_id = 'does_not_exist'
  43. GROUP BY mdco.id, from_operator_id, from_operator_address, to_operator_id, to_operator_address, from_port, to_port;
  44. # Note(parkmycar): This suceeds on web, but fails because of pg_repr using binary encoding.
  45. statement error binary encoding of list types is not implemented
  46. SELECT id, address, name, parent_id, arrangement_records, elapsed_ns FROM all_ops WHERE export_id = 'does_not_exist';
  47. # Ensure indexes are used where expected.
  48. query T multiline
  49. EXPLAIN OPTIMIZED PLAN WITH (humanized expressions) AS VERBOSE TEXT FOR SELECT * FROM mz_catalog.mz_kafka_sources
  50. ----
  51. Explained Query (fast path):
  52. ReadIndex on=mz_catalog.mz_kafka_sources mz_kafka_sources_ind=[*** full scan ***]
  53. Used Indexes:
  54. - mz_catalog.mz_kafka_sources_ind (*** full scan ***)
  55. Target cluster: mz_catalog_server
  56. EOF
  57. query T multiline
  58. EXPLAIN OPTIMIZED PLAN WITH (humanized expressions) AS VERBOSE TEXT FOR SELECT * FROM mz_internal.mz_webhook_sources
  59. ----
  60. Explained Query (fast path):
  61. ReadIndex on=mz_internal.mz_webhook_sources mz_webhook_sources_ind=[*** full scan ***]
  62. Used Indexes:
  63. - mz_internal.mz_webhook_sources_ind (*** full scan ***)
  64. Target cluster: mz_catalog_server
  65. EOF
  66. # ---- mz_object_history
  67. # Reset server to clear mz_object_history
  68. reset-server
  69. # Mock audit log timestamps to make test deterministic
  70. simple conn=mz_system,user=mz_system
  71. ALTER SYSTEM SET unsafe_mock_audit_event_timestamp = 666
  72. ----
  73. COMPLETE 0
  74. statement ok
  75. CREATE MATERIALIZED VIEW temp_view AS SELECT 1;
  76. statement ok
  77. DROP MATERIALIZED VIEW temp_view;
  78. query TTTTT
  79. SELECT id, cluster_id, object_type, created_at, dropped_at FROM mz_internal.mz_object_history WHERE id LIKE 'u%';
  80. ----
  81. u1 u1 materialized-view 1970-01-01␠00:00:00.666+00 1970-01-01␠00:00:00.666+00
  82. # ---- mz_cluster_replica_name_history
  83. statement ok
  84. CREATE CLUSTER foo REPLICAS ( weewoo1 (SIZE = '1') );
  85. statement ok
  86. ALTER CLUSTER REPLICA foo.weewoo1 RENAME TO weewoo2;
  87. query TT rowsort
  88. SELECT previous_name, new_name FROM mz_internal.mz_cluster_replica_name_history WHERE new_name = 'weewoo1' OR new_name = 'weewoo2';
  89. ----
  90. NULL weewoo1
  91. weewoo1 weewoo2
  92. statement ok
  93. DROP CLUSTER foo;