manishmalhotrawork commented on a change in pull request #499: Add persistent
IDs to partition fields (WIP)
URL: https://github.com/apache/incubator-iceberg/pull/499#discussion_r363076834
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -312,15 +314,20 @@ public TableMetadata updatePartitionSpec(PartitionSpec
newPartitionSpec) {
Preconditions.checkArgument(defaultSpecId != newDefaultSpecId,
"Cannot set default partition spec to the current default");
+ // start from last partition spec's fieldId
+ AtomicInteger nextPartitionFieldId = new
AtomicInteger(lastPartitionFieldId);
ImmutableList.Builder<PartitionSpec> builder =
ImmutableList.<PartitionSpec>builder()
.addAll(specs);
if (!specsById.containsKey(newDefaultSpecId)) {
// get a fresh spec to ensure the spec ID is set to the new default
- builder.add(freshSpec(newDefaultSpecId, schema, newPartitionSpec));
+ PartitionSpec freshSpec = freshSpecWithAssignIds(newDefaultSpecId,
schema, schema, newPartitionSpec,
+ nextPartitionFieldId, partitionFieldIdByColumnName);
Review comment:
@rdblue
are we referring to this
`Schema freshSchema = TypeUtil.assignFreshIds(schema,
lastColumnId::incrementAndGet);`
as `TypeUtil.assignFreshIds` assign id to the schema ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]