drop-cluster-cascade.td 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. $ kafka-create-topic topic=upsert
  10. > CREATE CONNECTION conn
  11. FOR KAFKA BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT
  12. > CREATE CLUSTER kept_cluster SIZE '1';
  13. > CREATE SOURCE kept_upsert
  14. IN CLUSTER kept_cluster
  15. FROM KAFKA CONNECTION conn (TOPIC
  16. 'testdrive-upsert-${testdrive.seed}'
  17. )
  18. > CREATE TABLE kept_upsert_tbl FROM SOURCE kept_upsert (REFERENCE "testdrive-upsert-${testdrive.seed}")
  19. KEY FORMAT TEXT VALUE FORMAT TEXT
  20. ENVELOPE UPSERT
  21. > DROP CLUSTER IF EXISTS c1 CASCADE;
  22. > CREATE CLUSTER c1 REPLICAS (replica1 (SIZE '1'));
  23. > CREATE SOURCE dropped_upsert
  24. IN CLUSTER c1
  25. FROM KAFKA CONNECTION conn (TOPIC
  26. 'testdrive-upsert-${testdrive.seed}'
  27. )
  28. > CREATE TABLE dropped_upsert_tbl FROM SOURCE dropped_upsert (REFERENCE "testdrive-upsert-${testdrive.seed}")
  29. KEY FORMAT TEXT VALUE FORMAT TEXT
  30. ENVELOPE UPSERT
  31. $ kafka-ingest format=bytes topic=upsert key-format=bytes key-terminator=:
  32. fish:fish
  33. bird:goose
  34. animal:whale
  35. > SELECT count(*) from dropped_upsert_tbl;
  36. 3
  37. > SELECT count(*) from kept_upsert_tbl;
  38. 3