avro-resolution-no-publish-reader.td 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 single-replica-cluster=quickstart
  10. #
  11. # Test the case where we fail to publish the schema of the reader
  12. #
  13. $ kafka-create-topic topic=resolution-no-publish-writer
  14. # The schema is {"type": "record", "name": "schema_int", "fields": [ {"name": "f1", "type": "int"} ] }.
  15. # and the value is {"f1": 123}
  16. # We encode it manually to avoid publishing it.
  17. $ kafka-ingest format=bytes topic=resolution-no-publish-writer timestamp=1
  18. \\x00\x00\x00\x00\x01\xf6\x01
  19. $ postgres-execute connection=postgres://mz_system@${testdrive.materialize-internal-sql-addr}/materialize
  20. DROP SCHEMA IF EXISTS public CASCADE
  21. CREATE SCHEMA public
  22. GRANT CREATE, USAGE ON SCHEMA public TO materialize
  23. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  24. URL '${testdrive.schema-registry-url}'
  25. );
  26. > CREATE CONNECTION kafka_conn
  27. TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  28. > CREATE SOURCE resolution_no_publish_writer
  29. IN CLUSTER ${arg.single-replica-cluster}
  30. FROM KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-resolution-no-publish-writer-${testdrive.seed}')
  31. ! CREATE TABLE resolution_no_publish_writer_tbl FROM SOURCE resolution_no_publish_writer (REFERENCE "testdrive-resolution-no-publish-writer-${testdrive.seed}")
  32. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  33. ENVELOPE NONE
  34. contains:No value schema found