setup.td 1.1 KB

123456789101112131415161718192021222324252627282930
  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=topic1
  10. > CREATE CLUSTER c1 REPLICAS (r1 (
  11. STORAGECTL ADDRESSES ['clusterd1:2100'],
  12. STORAGE ADDRESSES ['clusterd1:2103'],
  13. COMPUTECTL ADDRESSES ['clusterd1:2101'],
  14. COMPUTE ADDRESSES ['clusterd1:2102']
  15. ))
  16. > CREATE CONNECTION IF NOT EXISTS kafka_conn
  17. FOR KAFKA BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT;
  18. > CREATE SOURCE s1
  19. IN CLUSTER c1
  20. FROM KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-topic1-${testdrive.seed}');
  21. > CREATE TABLE s1_tbl FROM SOURCE s1 (REFERENCE "testdrive-topic1-${testdrive.seed}")
  22. KEY FORMAT TEXT VALUE FORMAT TEXT
  23. ENVELOPE UPSERT;
  24. > CREATE MATERIALIZED VIEW v1 AS SELECT COUNT(*) FROM s1_tbl;