kafka-upsert-sources-key-decode-error.td 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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-arg-default single-replica-cluster=quickstart
  10. $ set keyschema-1-int-key={
  11. "type": "record",
  12. "name": "Key",
  13. "fields": [
  14. {"name": "key", "type": "int"}
  15. ]
  16. }
  17. $ set keyschema-1-long-key={
  18. "type": "record",
  19. "name": "Key",
  20. "fields": [
  21. {"name": "key", "type": "long"}
  22. ]
  23. }
  24. $ set schema={
  25. "type" : "record",
  26. "name" : "test",
  27. "fields" : [
  28. {"name":"nokey", "type":"string"}
  29. ]
  30. }
  31. $ kafka-create-topic topic=int2long
  32. $ kafka-ingest format=avro topic=int2long key-format=avro key-schema=${keyschema-1-int-key} schema=${schema}
  33. {"key": 1234} {"nokey": "nokey1"}
  34. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  35. URL '${testdrive.schema-registry-url}'
  36. );
  37. > CREATE CONNECTION kafka_conn
  38. TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  39. > CREATE SOURCE int2long
  40. IN CLUSTER ${arg.single-replica-cluster}
  41. FROM KAFKA CONNECTION kafka_conn (TOPIC
  42. 'testdrive-int2long-${testdrive.seed}')
  43. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  44. ENVELOPE UPSERT
  45. $ kafka-ingest format=avro topic=int2long key-format=avro key-schema=${keyschema-1-long-key} schema=${schema}
  46. {"key": 999999999999} {"nokey": "nokey1"}
  47. ! SELECT * FROM int2long
  48. contains:Writer schema has type `Long`, but reader schema has type `Int` for field `Key.key`