avro-decode-no-record.td 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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. # Decoding a schema that is not a record results in a relation with a single column
  12. #
  13. $ set no-record
  14. "int"
  15. $ kafka-create-topic topic=avro-decode-no-record
  16. $ kafka-ingest format=avro topic=avro-decode-no-record schema=${no-record} timestamp=1
  17. 123
  18. > CREATE CONNECTION kafka_conn
  19. TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  20. > CREATE SOURCE avro_decode_no_record
  21. IN CLUSTER ${arg.single-replica-cluster}
  22. FROM KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-avro-decode-no-record-${testdrive.seed}')
  23. FORMAT AVRO USING SCHEMA '${no-record}'
  24. ENVELOPE NONE
  25. > SHOW COLUMNS FROM avro_decode_no_record
  26. name nullable type comment
  27. -------------------------------------
  28. \?column? false integer ""