drop-source-in-cluster.td 1.3 KB

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