WZhuo opened a new pull request, #832: URL: https://github.com/apache/iceberg-cpp/pull/832
FreshPartitionSpec and TableMetadataBuilder::Impl both initialized the partition field ID counter to `kInvalidPartitionFieldId` (-1), causing the first partition field to get ID **0** instead of **1000**. Partition field ID 0 collides with ManifestEntry internal fields: | Field | ID | |---|---| | `ManifestEntry.status` | 0 | | `ManifestEntry.snapshot_id` | 1 | | `ManifestEntry.data_file` | 2 | This corrupts manifest file schemas during serialization and breaks partition pruning. ## Fix Change both initializers to `kLegacyPartitionDataIdStart - 1` (999), consistent with Java Iceberg's `PARTITION_DATA_ID_START` convention and the rest of the C++ codebase (`PartitionSpec` constructor, `Unpartitioned()`, `UpdatePartitionSpec`). The first partition field now correctly gets ID **1000**. | Location | Before | After | |---|---|---| | `FreshPartitionSpec` counter | -1 | 999 | | `TableMetadataBuilder::Impl::last_partition_id` | -1 | 999 | | First partition field ID | 0 | **1000** | -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
