create-in-v0.27.0-schema-registry.td 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 schema={
  10. "type": "record",
  11. "name": "foo",
  12. "fields": [
  13. {"name": "a", "type": "int"}
  14. ]
  15. }
  16. $ kafka-create-topic topic=data
  17. $ kafka-ingest format=avro topic=data schema=${schema}
  18. {"a": 1}
  19. > CREATE CONNECTION IF NOT EXISTS csr_conn
  20. FOR CONFLUENT SCHEMA REGISTRY
  21. URL '${testdrive.schema-registry-url}';
  22. > CREATE CONNECTION IF NOT EXISTS kafka_conn TO KAFKA (
  23. BROKER '${testdrive.kafka-addr}',
  24. SECURITY PROTOCOL PLAINTEXT
  25. )
  26. > CREATE SOURCE data
  27. FROM KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-data-${testdrive.seed}')
  28. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  29. ENVELOPE NONE
  30. > SELECT * FROM data
  31. 1