40-check-types.td 1.7 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. $ sql-server-connect name=sql-server
  10. server=tcp:sql-server,1433;IntegratedSecurity=true;TrustServerCertificate=true;User ID=sa;Password=${arg.sa-password}
  11. $ schema-registry-wait topic=sql-server.test.dbo.types_table
  12. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  13. URL '${testdrive.schema-registry-url}'
  14. );
  15. > CREATE CONNECTION IF NOT EXISTS kafka_conn TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  16. > CREATE SOURCE types_table
  17. FROM KAFKA CONNECTION kafka_conn (TOPIC 'sql-server.test.dbo.types_table');
  18. > CREATE TABLE types_table_tbl FROM SOURCE types_table (REFERENCE "sql-server.test.dbo.types_table")
  19. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  20. ENVELOPE DEBEZIUM;
  21. #
  22. # DATETIMEOFFSET is replicated as TEXT, see https://github.com/MaterializeInc/database-issues/issues/2453
  23. # DATETIME2 is replicated as BIGINT, see https://github.com/MaterializeInc/database-issues/issues/2458
  24. # SMALLDATETIME does not store seconds or fractional seconds
  25. > SELECT * FROM types_table_tbl
  26. 123.45 "2025-12-10T12:32:10+01:00" "1289567655123456700" "1900-01-01 11:12:00" true 0
  27. > SELECT pg_typeof(decimal_col), pg_typeof(datetimeoffset_col), pg_typeof(datetime2_col), pg_typeof(smalldatetime_col), pg_typeof(bit_col) FROM types_table_tbl;
  28. numeric text bigint "timestamp without time zone" boolean