setup.td 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  10. ALTER SYSTEM SET unsafe_enable_unorchestrated_cluster_replicas = true
  11. $ kafka-create-topic topic=topic partitions=1
  12. $ kafka-ingest format=bytes topic=topic
  13. one
  14. two
  15. three
  16. > CREATE CLUSTER clusterd REPLICAS (
  17. r1 (
  18. STORAGECTL ADDRESSES ['clusterd:2100'],
  19. STORAGE ADDRESSES ['clusterd:2103'],
  20. COMPUTECTL ADDRESSES ['clusterd:2101'],
  21. COMPUTE ADDRESSES ['clusterd:2102'],
  22. WORKERS 4
  23. )
  24. )
  25. > CREATE CONNECTION conn TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT)
  26. > CREATE SOURCE topic
  27. IN CLUSTER clusterd
  28. FROM KAFKA CONNECTION conn (
  29. TOPIC 'testdrive-topic-${testdrive.seed}'
  30. )
  31. > CREATE TABLE topic_tbl
  32. FROM SOURCE topic (REFERENCE "testdrive-topic-${testdrive.seed}")
  33. FORMAT BYTES
  34. INCLUDE OFFSET
  35. ENVELOPE NONE