envelope-none-before.td 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. "type" : "record",
  11. "name" : "test",
  12. "fields" : [
  13. {"name":"f1", "type":"long"}
  14. ]
  15. }
  16. $ kafka-create-topic topic=envelope-none partitions=2
  17. # Make sure that no upsert semantics kicks in -- all the 15K records we insert must be processed independently
  18. $ kafka-ingest format=avro topic=envelope-none schema=${schema} repeat=5000
  19. {"f1": ${kafka-ingest.iteration}}
  20. $ kafka-ingest format=avro topic=envelope-none key-format=avro key-schema=${schema} schema=${schema} repeat=5000
  21. {"f1": ${kafka-ingest.iteration}} {"f1": ${kafka-ingest.iteration}}
  22. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  23. URL '${testdrive.schema-registry-url}'
  24. );
  25. > CREATE CONNECTION IF NOT EXISTS kafka_conn TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  26. > CREATE SOURCE envelope_none
  27. FROM KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-envelope-none-${testdrive.seed}')
  28. > CREATE TABLE envelope_none_tbl FROM SOURCE envelope_none (REFERENCE "testdrive-envelope-none-${testdrive.seed}")
  29. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  30. INCLUDE PARTITION AS kafka_partition, OFFSET AS mz_offset
  31. ENVELOPE NONE
  32. > SELECT COUNT(*) FROM envelope_none_tbl
  33. 10000
  34. $ kafka-add-partitions topic=envelope-none total-partitions=4