szehon-ho commented on code in PR #6365:
URL: https://github.com/apache/iceberg/pull/6365#discussion_r1052722621
##########
core/src/main/java/org/apache/iceberg/BaseMetadataTable.java:
##########
@@ -64,9 +64,12 @@ protected BaseMetadataTable(TableOperations ops, Table
table, String name) {
*/
static PartitionSpec transformSpec(Schema metadataTableSchema, PartitionSpec
spec) {
PartitionSpec.Builder identitySpecBuilder =
- PartitionSpec.builderFor(metadataTableSchema).checkConflicts(false);
+ PartitionSpec.builderFor(metadataTableSchema)
+ .withSpecId(spec.specId())
+ .checkConflicts(false);
for (PartitionField field : spec.fields()) {
- identitySpecBuilder.add(field.fieldId(), field.name(),
Transforms.identity());
+ identitySpecBuilder.add(
+ field.fieldId(), field.fieldId(), field.name(),
Transforms.identity());
Review Comment:
Hey, I tried this, and didnt work, it breaks some validation saying that the
source id column is not on the table.
So, this is for the transform of partition spec for data table -> partition
spec for metadata table (for partition push down for metadata table). I think
what's going on is that on the metadata table it's kind of an artificial
partition spec, and because all the original source columns in data table are
not present in metadata table, we re-use the partition field id for the source
id. So both source/field id are the transform field id. This is what I recall
at least.
--
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]