flyrain commented on code in PR #8928:
URL: https://github.com/apache/iceberg/pull/8928#discussion_r1376706853
##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java:
##########
@@ -337,7 +337,7 @@ private void replaceManifests(
addedManifests.forEach(rewriteManifests::addManifest);
commit(rewriteManifests);
- if (!snapshotIdInheritanceEnabled) {
+ if (formatVersion == 1 && !snapshotIdInheritanceEnabled) {
Review Comment:
Minor suggestion: can we have format version as an extra parameter for the
method as following, so that we can consolidate the logic from multiple places?
```
PropertyUtil.propertyAsBoolean(
table.properties(),
TableProperties.SNAPSHOT_ID_INHERITANCE_ENABLED,
TableProperties.SNAPSHOT_ID_INHERITANCE_ENABLED_DEFAULT,
formatVersion);
```
##########
core/src/main/java/org/apache/iceberg/BaseRewriteManifests.java:
##########
@@ -82,10 +83,12 @@ public class BaseRewriteManifests extends
SnapshotProducer<RewriteManifests>
this.manifestTargetSizeBytes =
ops.current()
.propertyAsLong(MANIFEST_TARGET_SIZE_BYTES,
MANIFEST_TARGET_SIZE_BYTES_DEFAULT);
- this.snapshotIdInheritanceEnabled =
+ this.formatVersion = ops.current().formatVersion();
+ boolean snapshotIdInheritanceEnabled =
ops.current()
.propertyAsBoolean(
SNAPSHOT_ID_INHERITANCE_ENABLED,
SNAPSHOT_ID_INHERITANCE_ENABLED_DEFAULT);
+ this.canInheritSnapshotId = formatVersion > 1 ||
snapshotIdInheritanceEnabled;
Review Comment:
We may update the
doc(https://iceberg.apache.org/docs/latest/configuration/#compatibility-flags)
a bit to be clear that v2 table doesn't honor the property
`compatibility.snapshot-id-inheritance.enabled`, in case people get confused.
Not a blocker. We can do it in a follow up PR.
--
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]