exactly-once-sink-after.td 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 keyschema={
  10. "type": "record",
  11. "name": "Key",
  12. "fields": [
  13. {"name": "f1", "type": "long"}
  14. ]
  15. }
  16. $ set schema={
  17. "type" : "record",
  18. "name" : "test",
  19. "fields" : [
  20. {"name":"f2", "type":"long"}
  21. ]
  22. }
  23. $ kafka-ingest format=avro topic=exactly-once key-format=avro key-schema=${keyschema} schema=${schema} repeat=2 start-iteration=40
  24. {"f1": ${kafka-ingest.iteration}} {"f2": ${kafka-ingest.iteration}}
  25. > SELECT COUNT(*) FROM exactly_once_tbl;
  26. 10
  27. # We expect just the 6 new messages, having consumed the older ones in xactly-once-sink-before.td
  28. $ kafka-verify-data format=avro sink=materialize.public.exactly_once_sink sort-messages=true
  29. {"before":null,"after":{"row":{"f1":20,"f2":20}}}
  30. {"before":null,"after":{"row":{"f1":21,"f2":21}}}
  31. {"before":null,"after":{"row":{"f1":30,"f2":30}}}
  32. {"before":null,"after":{"row":{"f1":31,"f2":31}}}
  33. {"before":null,"after":{"row":{"f1":40,"f2":40}}}
  34. {"before":null,"after":{"row":{"f1":41,"f2":41}}}