What YAML is
YAML uses indentation instead of brackets. It is a superset of JSON, supports comments, and is meant to be edited by hand.
Kubernetes manifests, CI pipelines, Ansible playbooks and most modern config files.
What Avro Schema is
An Avro schema describes a record: its name and its typed fields. It is the contract, not the data.
Kafka pipelines and anything in the Hadoop family.
What changes when you convert YAML to Avro Schema
A YAML list of maps reads as rows and columns directly. Anchors and aliases are resolved before the table is built, so a repeated block arrives expanded rather than as a reference.
Types are inferred per column from the values present. Any column with a gap in it becomes a union with null, because a reader rejects a record whose non-nullable field is missing.
What carries over from YAML to Avro Schema
Avro can express everything YAML holds about a table, so this conversion is about shape rather than loss.
The result can be read a record at a time, and appended to by adding to the end of it. That is worth having for a table too large to hold in memory, and it means a Avro file that is cut off part way through still gives you every record before the cut.
Both formats record types, so numbers, booleans and nulls survive as themselves rather than as text.