Hi Ryan, I noticed, TableMetadata.buildReplacement() is adding old partition spec to the new TableMetadata.
ImmutableList.Builder<PartitionSpec> builder = ImmutableList.<PartitionSpec>builder() .addAll(specs); if (!specsById.containsKey(specId)) { builder.add(freshSpec); } I'm working expire metadata with ExpireSnapshots, as part of this I'm updating TestTableOperations.commit to write and read metadata json file. This change is breaking TestReplaceTransaction.testReplaceWithIncompatibleSchemaUpdate test case, because PartitionSpecParser.fromJson() is trying to read a column which is not present in the replaced schema. Should we change the logic to add old specs only if specId is not present in the specsById as below? ImmutableList.Builder<PartitionSpec> builder = ImmutableList.<PartitionSpec>builder(); if (!specsById.containsKey(specId)) { builder.add(freshSpec); } else { builder.addAll(specs); } Thanks, Yathi