Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions table-topic-solutions/playground/append-scenario/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice idea with this field versioning - easy to follow and see what is new and in case of more changes needed can be still possible to follow without making diffs on those files

]
}
Original file line number Diff line number Diff line change
@@ -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}
Copy link

@dumbNickname dumbNickname Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in my example I used obligatory field - I think I tried to specify as optional first and later redefine to obligatory but that indeed would be incompatible schema evolution. (not sure if that will matter but just mentioning)

]
}
Original file line number Diff line number Diff line change
@@ -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}
]
}
Loading