avro-decode-no-record.td 1.3 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-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. > CREATE TABLE avro_decode_no_record_tbl FROM SOURCE avro_decode_no_record (REFERENCE "testdrive-avro-decode-no-record-${testdrive.seed}")
  24. FORMAT AVRO USING SCHEMA '${no-record}'
  25. ENVELOPE NONE
  26. > SHOW COLUMNS FROM avro_decode_no_record_tbl
  27. name nullable type comment
  28. -------------------------------------
  29. \?column? false integer ""