You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "manuzhang (via GitHub)" <gi...@apache.org> on 2026/04/18 09:25:16 UTC
[PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
manuzhang opened a new pull request, #16027:
URL: https://github.com/apache/iceberg/pull/16027
This PR adds tests for this particular statement from the [spec v3](https://iceberg.apache.org/spec/#version-3).
> Position delete files that contain deletes for more than one data file need to be kept in table metadata until all deletes are replaced by DVs
---
Co-authored-by: @codex
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#issuecomment-5299399351
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#issuecomment-4898931456
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#issuecomment-5672796397
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "RussellSpitzer (via GitHub)" <gi...@apache.org>.
RussellSpitzer commented on code in PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#discussion_r3319821280
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java:
##########
@@ -857,6 +857,44 @@ public void testRewriteV2PositionDeletesToV3DVs() throws IOException {
.isEmpty();
}
+ @TestTemplate
+ public void testRewriteSharedV2PositionDeletesToV3DVsRemovesLegacyDeleteFiles()
Review Comment:
This seems sensible to me, @nastra do you have any other issues on this one?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#issuecomment-4828073609
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "manuzhang (via GitHub)" <gi...@apache.org>.
manuzhang commented on code in PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#discussion_r3112105470
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java:
##########
@@ -857,6 +857,44 @@ public void testRewriteV2PositionDeletesToV3DVs() throws IOException {
.isEmpty();
}
+ @TestTemplate
+ public void testRewriteSharedV2PositionDeletesToV3DVsRemovesLegacyDeleteFiles()
Review Comment:
There's only one position delete file referencing two data files.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #16027: Spark 4.1: Test legacy position deletes when upgrading to v3 tables
URL: https://github.com/apache/iceberg/pull/16027
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "huaxingao (via GitHub)" <gi...@apache.org>.
huaxingao commented on code in PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#discussion_r3105576083
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/source/TestSparkReaderDeletes.java:
##########
@@ -415,6 +420,87 @@ public void testPosDeletesWithDeletedColumn() throws IOException {
checkDeleteCount(4L);
}
+ @TestTemplate
+ public void testSharedPositionDeletesAreRetainedDuringPartialDVReplacement() throws IOException {
+ assumeThat(format).isEqualTo(FileFormat.PARQUET);
+ assumeThat(formatVersion).isEqualTo(3);
+
+ String tableName = "test3";
+ Table table = createTable(tableName, SCHEMA, 2);
+
+ GenericRecord record = GenericRecord.create(table.schema());
+ List<Record> firstFileRecords =
+ Lists.newArrayList(
+ record.copy("id", 1, "data", "a"),
+ record.copy("id", 2, "data", "b"),
+ record.copy("id", 3, "data", "c"));
+ List<Record> secondFileRecords =
+ Lists.newArrayList(
+ record.copy("id", 4, "data", "d"),
+ record.copy("id", 5, "data", "e"),
+ record.copy("id", 6, "data", "f"));
+
+ DataFile firstDataFile =
+ FileHelpers.writeDataFile(
+ table,
+ Files.localOutput(temp.resolve("junit" + System.nanoTime()).toFile()),
+ TestHelpers.Row.of(),
+ firstFileRecords);
+ DataFile secondDataFile =
+ FileHelpers.writeDataFile(
+ table,
+ Files.localOutput(temp.resolve("junit" + System.nanoTime()).toFile()),
+ TestHelpers.Row.of(),
+ secondFileRecords);
+ table.newAppend().appendFile(firstDataFile).appendFile(secondDataFile).commit();
+
+ Pair<DeleteFile, CharSequenceSet> sharedPositionDeletes =
+ FileHelpers.writeDeleteFile(
+ table,
+ Files.localOutput(temp.resolve("junit" + System.nanoTime()).toFile()),
+ TestHelpers.Row.of(),
+ Lists.newArrayList(
+ Pair.of(firstDataFile.location(), 0L),
+ Pair.of(firstDataFile.location(), 1L),
+ Pair.of(secondDataFile.location(), 0L)),
+ 2);
+ table
+ .newRowDelta()
+ .addDeletes(sharedPositionDeletes.first())
+ .validateDataFilesExist(sharedPositionDeletes.second())
+ .commit();
+
+ table.updateProperties().set(TableProperties.FORMAT_VERSION, "3").commit();
+
+ Pair<DeleteFile, CharSequenceSet> secondFileDV =
+ FileHelpers.writeDeleteFile(
+ table,
+ Files.localOutput(temp.resolve("junit" + System.nanoTime()).toFile()),
+ TestHelpers.Row.of(),
+ Lists.newArrayList(
+ Pair.of(secondDataFile.location(), 0L), Pair.of(secondDataFile.location(), 1L)),
+ 3);
+ table
+ .newRowDelta()
+ .addDeletes(secondFileDV.first())
+ .validateDataFilesExist(secondFileDV.second())
+ .commit();
+
+ StructLikeSet actual = rowSet(tableName, table, "*");
+ StructLikeSet expected = rowSetWithoutIds(table, firstFileRecords, 1, 2);
+ expected.addAll(rowSetWithoutIds(table, secondFileRecords, 4, 5));
+ assertThat(actual).as("Table should contain expected rows").isEqualTo(expected);
+
+ try (CloseableIterable<FileScanTask> tasks = table.newScan().planFiles()) {
+ List<FileScanTask> fileTasks = Lists.newArrayList(tasks);
+ assertThat(fileTasks).hasSize(2);
+ assertThat(fileTasks).allSatisfy(task -> assertThat(task.deletes()).hasSize(1));
+ assertThat(fileTasks)
+ .extracting(task -> task.deletes().get(0).format())
+ .containsExactlyInAnyOrder(FileFormat.PARQUET, FileFormat.PUFFIN);
Review Comment:
nit: This only checks that one task has a PARQUET delete and the other has a PUFFIN delete. Should we also check which data file gets which?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #16027: Spark 4.1: Test legacy position deletes when upgrading to v3 tables
URL: https://github.com/apache/iceberg/pull/16027
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#issuecomment-5210812201
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#issuecomment-5786806434
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "manuzhang (via GitHub)" <gi...@apache.org>.
manuzhang commented on code in PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#discussion_r3112074169
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java:
##########
@@ -857,6 +857,44 @@ public void testRewriteV2PositionDeletesToV3DVs() throws IOException {
.isEmpty();
}
+ @TestTemplate
+ public void testRewriteSharedV2PositionDeletesToV3DVsRemovesLegacyDeleteFiles()
Review Comment:
The position delete file is shared by two data files.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #16027: Spark 4.1: Test legacy position deletes when upgrading to v3 tables
URL: https://github.com/apache/iceberg/pull/16027
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "huaxingao (via GitHub)" <gi...@apache.org>.
huaxingao commented on code in PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#discussion_r3105578500
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/source/TestSparkReaderDeletes.java:
##########
@@ -242,6 +217,36 @@ public StructLikeSet rowSet(String name, Types.StructType projection, String...
return set;
}
+ private Table createTable(String name, Schema schema, int tableFormatVersion) {
Review Comment:
nit: should this helper method go to the bottom of the test class?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#discussion_r3109466975
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java:
##########
@@ -857,6 +857,44 @@ public void testRewriteV2PositionDeletesToV3DVs() throws IOException {
.isEmpty();
}
+ @TestTemplate
+ public void testRewriteSharedV2PositionDeletesToV3DVsRemovesLegacyDeleteFiles()
Review Comment:
how is this test different from testRewriteV2PositionDeletesToV3DVs?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "manuzhang (via GitHub)" <gi...@apache.org>.
manuzhang commented on code in PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#discussion_r3112074169
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java:
##########
@@ -857,6 +857,44 @@ public void testRewriteV2PositionDeletesToV3DVs() throws IOException {
.isEmpty();
}
+ @TestTemplate
+ public void testRewriteSharedV2PositionDeletesToV3DVsRemovesLegacyDeleteFiles()
Review Comment:
The position delete file is shared by two data files.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "manuzhang (via GitHub)" <gi...@apache.org>.
manuzhang commented on PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#issuecomment-4899620710
Thanks @nastra @RussellSpitzer for review. Do you have more comments?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#discussion_r3109466975
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewritePositionDeleteFilesAction.java:
##########
@@ -857,6 +857,44 @@ public void testRewriteV2PositionDeletesToV3DVs() throws IOException {
.isEmpty();
}
+ @TestTemplate
+ public void testRewriteSharedV2PositionDeletesToV3DVsRemovesLegacyDeleteFiles()
Review Comment:
how is this test different from testRewriteV2PositionDeletesToV3DVs that is right above this method?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Spark 4.1: Test legacy position deletes when upgrading to v3 tables [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16027:
URL: https://github.com/apache/iceberg/pull/16027#issuecomment-4513953234
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org