diff --git a/table-topic-solutions/playground/append-scenario/justfile b/table-topic-solutions/playground/append-scenario/justfile index f28a7f5..315ab75 100644 --- a/table-topic-solutions/playground/append-scenario/justfile +++ b/table-topic-solutions/playground/append-scenario/justfile @@ -25,15 +25,26 @@ create-topic topic='orders': --config automq.table.topic.transform.value.type=flatten \ --config automq.table.topic.namespace=default || true -send-auto topic='orders' count='10': +send-auto topic='orders' count='2': @echo "Producing {{count}} Avro messages (auto-register) to {{topic}}" SCHEMA_REGISTRY_URL={{SCHEMA_REGISTRY_URL}} bash append-scenario/scripts/produce-avro-auto.sh {{topic}} {{count}} -send-auto-v2 topic='orders' count='10': +send-auto-v2 topic='orders' count='2': @echo "Producing {{count}} Avro messages (OrderV2 aggregated evolution) to {{topic}}" SCHEMA_REGISTRY_URL={{SCHEMA_REGISTRY_URL}} SCHEMA_FILE=append-scenario/schemas/OrderV2.avsc \ bash append-scenario/scripts/produce-avro-auto.sh {{topic}} {{count}} +send-auto-v3 topic='orders' count='2': + @echo "Producing {{count}} Avro messages (OrderV3 aggregated evolution) to {{topic}}" + SCHEMA_REGISTRY_URL={{SCHEMA_REGISTRY_URL}} SCHEMA_FILE=append-scenario/schemas/OrderV3.avsc \ + bash append-scenario/scripts/produce-avro-auto.sh {{topic}} {{count}} + +send-auto-v4 topic='orders' count='2': + @echo "Producing {{count}} Avro messages (OrderV4 aggregated evolution) to {{topic}}" + SCHEMA_REGISTRY_URL={{SCHEMA_REGISTRY_URL}} SCHEMA_FILE=append-scenario/schemas/OrderV4.avsc \ + bash append-scenario/scripts/produce-avro-auto.sh {{topic}} {{count}} + + query table='orders': @just trino-sql "SELECT * FROM iceberg.default.\"{{table}}\" LIMIT 20" diff --git a/table-topic-solutions/playground/append-scenario/schemas/OrderV2.avsc b/table-topic-solutions/playground/append-scenario/schemas/OrderV2.avsc index c6496e0..7a5d0f7 100644 --- a/table-topic-solutions/playground/append-scenario/schemas/OrderV2.avsc +++ b/table-topic-solutions/playground/append-scenario/schemas/OrderV2.avsc @@ -6,7 +6,6 @@ {"name": "order_id", "type": "long"}, {"name": "product_name", "type": "string"}, {"name": "order_description", "type": ["null", "string"], "default": null}, - {"name": "price", "type": "double", "default": 0.0}, - {"name": "quantity", "type": "long", "default": 0} + {"name": "f_v2", "type": ["null", "string"], "default": null} ] } diff --git a/table-topic-solutions/playground/append-scenario/schemas/OrderV3.avsc b/table-topic-solutions/playground/append-scenario/schemas/OrderV3.avsc new file mode 100644 index 0000000..bf2ea08 --- /dev/null +++ b/table-topic-solutions/playground/append-scenario/schemas/OrderV3.avsc @@ -0,0 +1,11 @@ +{ + "type": "record", + "name": "Order", + "namespace": "demo.append", + "fields": [ + {"name": "order_id", "type": "long"}, + {"name": "product_name", "type": "string"}, + {"name": "order_description", "type": ["null", "string"], "default": null}, + {"name": "f_v3", "type": ["null", "string"], "default": null} + ] +} diff --git a/table-topic-solutions/playground/append-scenario/schemas/OrderV4.avsc b/table-topic-solutions/playground/append-scenario/schemas/OrderV4.avsc new file mode 100644 index 0000000..5a3e330 --- /dev/null +++ b/table-topic-solutions/playground/append-scenario/schemas/OrderV4.avsc @@ -0,0 +1,12 @@ +{ + "type": "record", + "name": "Order", + "namespace": "demo.append", + "fields": [ + {"name": "order_id", "type": "long"}, + {"name": "product_name", "type": "string"}, + {"name": "order_description", "type": ["null", "string"], "default": null}, + {"name": "f_v2", "type": ["null", "string"], "default": null}, + {"name": "f_v3", "type": ["null", "string"], "default": null} + ] +}