mz-kafka-sources.td 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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. FORMAT BYTES
  22. > SELECT
  23. ks.topic
  24. FROM mz_sources s
  25. JOIN mz_catalog.mz_kafka_sources ks ON s.id = ks.id
  26. WHERE s.name = 'topic'
  27. testdrive-topic-${testdrive.seed}