2 ms·
Compare with the usual rules for protobuf evolution: All fields are optional. This is because fields have a lifecycle. Your code might be reading data generate
by skybrian 3y ago
Compare with the usual rules for protobuf evolution:
All fields are optional. This is because fields have a lifecycle. Your code might be reading data generated by some other code written before the field was defined, or generated by some other code written after the field became obsolete.
With protobufs, you can never reuse a field number. However, you can remove a field (keeping its number reserved), which effectively means ignoring it in new applications. It's neither read nor written, which is fine because see above.
You can also rename the field itself. This doesn't affect the wire protocol.
It seems more sensible than having misleading names around for people to trip over. Maybe we'd be better off if databases used field numbers to refer to columns in the wire protocol?
- sundbry 3y agoThis is one nice property of Apache Iceberg (a data lake format, built on top of Parquet). The schemas in the data are evolvable, and require both a name and a field ID to identify the field. The names are changeable, but the ID's are immutable, so you can remove a field, and add a new field by the same name, having a different type.