mz-kafka-sources.td 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. $ set-arg-default default-storage-size=1
  10. # Test that the source ingestion pipeline commits offsets back to Kafka with
  11. # the expected group ID.
  12. # Initial setup.
  13. $ kafka-create-topic topic=topic partitions=1
  14. > CREATE CONNECTION conn TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT)
  15. > CREATE CLUSTER topic_cluster SIZE '${arg.default-storage-size}';
  16. > CREATE SOURCE topic
  17. IN CLUSTER topic_cluster
  18. FROM KAFKA CONNECTION conn (
  19. TOPIC 'testdrive-topic-${testdrive.seed}'
  20. )
  21. > CREATE TABLE topic_tbl FROM SOURCE topic (REFERENCE "testdrive-topic-${testdrive.seed}")
  22. FORMAT BYTES
  23. > SELECT
  24. ks.topic
  25. FROM mz_sources s
  26. JOIN mz_catalog.mz_kafka_sources ks ON s.id = ks.id
  27. WHERE s.name = 'topic'
  28. testdrive-topic-${testdrive.seed}