create-in-v0.27.0-compile-proto-sources.td 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. syntax = "proto3";
  11. message Message {
  12. string id = 1;
  13. }
  14. $ file-append path=message.proto
  15. \${schema}
  16. $ protobuf-compile-descriptors inputs=message.proto output=message.pb set-var=message-schema
  17. $ kafka-create-topic topic=upgrade-proto-source-${arg.upgrade-from-version}
  18. $ schema-registry-publish subject=testdrive-upgrade-proto-source-${arg.upgrade-from-version}-${testdrive.seed}-value schema-type=protobuf
  19. \${schema}
  20. $ kafka-ingest topic=upgrade-proto-source-${arg.upgrade-from-version} format=protobuf descriptor-file=message.pb message=Message confluent-wire-format=true
  21. {"id": "c"}
  22. {"id": "h"}
  23. > CREATE CONNECTION IF NOT EXISTS csr_conn
  24. FOR CONFLUENT SCHEMA REGISTRY
  25. URL '${testdrive.schema-registry-url}';
  26. >[version>=7800] CREATE CONNECTION IF NOT EXISTS kafka_conn TO KAFKA (
  27. BROKER '${testdrive.kafka-addr}',
  28. SECURITY PROTOCOL PLAINTEXT
  29. )
  30. >[version<7800] CREATE CONNECTION IF NOT EXISTS kafka_conn TO KAFKA (
  31. BROKER '${testdrive.kafka-addr}'
  32. )
  33. > CREATE SOURCE kafka_proto_source
  34. FROM KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-upgrade-proto-source-${arg.upgrade-from-version}-${testdrive.seed}')
  35. FORMAT PROTOBUF USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn