delayed-materialization-after.td 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. # Insert 10K values prior to restart and check that we never re-ingest
  11. # the entire topic as observed by the librdkafka counters
  12. #
  13. $ set count=10000
  14. $ set keyschema={
  15. "type": "record",
  16. "name": "Key",
  17. "fields": [
  18. {"name": "f1", "type": "string"}
  19. ]
  20. }
  21. $ set schema={
  22. "type" : "record",
  23. "name" : "test",
  24. "fields" : [
  25. {"name":"f2", "type":"string"}
  26. ]
  27. }
  28. $ kafka-ingest format=avro topic=delayed-materialization key-format=avro key-schema=${keyschema} schema=${schema} repeat=${count}
  29. {"f1": "a${kafka-ingest.iteration}"} {"f2": "a${kafka-ingest.iteration}"}
  30. > CREATE DEFAULT INDEX ON materialized_via_create_index_after_restart_tbl;
  31. > CREATE MATERIALIZED VIEW materialized_via_create_materialized_view_after_restart_view AS SELECT COUNT(*) AS f1 FROM materialized_via_create_materialized_view_after_restart_tbl;
  32. > SELECT COUNT(*) FROM materialized_via_create_index_before_restart_tbl;
  33. "${count}"
  34. > SELECT COUNT(*) FROM materialized_via_create_index_after_restart_tbl;
  35. "${count}"
  36. > SELECT f1 FROM materialized_via_create_materialized_view_before_restart_view;
  37. "${count}"
  38. > SELECT f1 FROM materialized_via_create_materialized_view_after_restart_view;
  39. "${count}"