25-types-array.td 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #
  10. # ARRAY columns are supported
  11. #
  12. $ postgres-execute connection=postgres://postgres:postgres@postgres
  13. CREATE TABLE array_type (f1 text[], f2 INTEGER PRIMARY KEY);
  14. INSERT INTO array_type VALUES ('{foo, null}', 0);
  15. $ schema-registry-wait topic=postgres.public.array_type
  16. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  17. URL '${testdrive.schema-registry-url}'
  18. );
  19. > CREATE CONNECTION IF NOT EXISTS kafka_conn TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  20. > CREATE SOURCE array_type
  21. FROM KAFKA CONNECTION kafka_conn (TOPIC 'postgres.public.array_type')
  22. > CREATE TABLE array_type_tbl FROM SOURCE array_type (REFERENCE "postgres.public.array_type")
  23. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  24. ENVELOPE DEBEZIUM
  25. # Cast to `text` to work around TD's lack of support for PG arrays
  26. > SELECT f1::text FROM array_type_tbl
  27. f1
  28. ---
  29. {foo,NULL}