This discussion is a follow up of this comment, in summary, I'm thinking about make PartitionSpec safe with following changes:
- Making all fields private to this struct.
- Add a
schema field to PartitionSpec.
This will introduce several changes:
PartitionSpec could only be built using builder, which has checks for serveral parts to ensure it's correct
PartitionSpec's partition type could be infered by itself
- We may need to change the deserialization of
TableMetadata to use builder to build it.