github-7242.td 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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-sql-timeout duration=60s
  10. $ set-arg-default single-replica-cluster=quickstart
  11. > CREATE SOURCE tpch
  12. IN CLUSTER ${arg.single-replica-cluster}
  13. FROM LOAD GENERATOR TPCH (SCALE FACTOR 0.1, UP TO 1000);
  14. > CREATE TABLE customer FROM SOURCE tpch (REFERENCE customer);
  15. > CREATE TABLE lineitem FROM SOURCE tpch (REFERENCE lineitem);
  16. > CREATE TABLE nation FROM SOURCE tpch (REFERENCE nation);
  17. > CREATE TABLE orders FROM SOURCE tpch (REFERENCE orders);
  18. > CREATE TABLE part FROM SOURCE tpch (REFERENCE part);
  19. > CREATE TABLE partsupp FROM SOURCE tpch (REFERENCE partsupp);
  20. > CREATE TABLE region FROM SOURCE tpch (REFERENCE region);
  21. > CREATE TABLE supplier FROM SOURCE tpch (REFERENCE supplier);
  22. > CREATE CONNECTION kafka_fixed TO KAFKA (
  23. BROKER '${testdrive.kafka-addr}',
  24. PROGRESS TOPIC 'testdrive-progress-fixed-${testdrive.seed}',
  25. SECURITY PROTOCOL PLAINTEXT
  26. );
  27. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  28. URL '${testdrive.schema-registry-url}'
  29. );
  30. > CREATE SINK sink
  31. IN CLUSTER ${arg.single-replica-cluster}
  32. FROM supplier
  33. INTO KAFKA CONNECTION kafka_fixed (TOPIC 'testdrive-supplier-${testdrive.seed}')
  34. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  35. ENVELOPE DEBEZIUM
  36. # Wait for the sink to create the topic
  37. $ kafka-wait-topic topic=testdrive-supplier-${testdrive.seed} partitions=1
  38. > CREATE SOURCE progress_check
  39. IN CLUSTER ${arg.single-replica-cluster}
  40. FROM KAFKA CONNECTION kafka_fixed (TOPIC 'testdrive-progress-fixed-${testdrive.seed}')
  41. > CREATE TABLE progress_check_tbl FROM SOURCE progress_check (REFERENCE "testdrive-progress-fixed-${testdrive.seed}")
  42. FORMAT JSON ENVELOPE NONE
  43. > SELECT COUNT(*) FROM progress_check_tbl WHERE data->'frontier' = '[]'::jsonb;
  44. 1