nastra commented on code in PR #12014: URL: https://github.com/apache/iceberg/pull/12014#discussion_r1942397562
########## core/src/test/java/org/apache/iceberg/TestMetadataTableScans.java: ########## @@ -1730,6 +1732,16 @@ public void testPositionDeletesManyColumns() { assertThat(scanTasks.get(1).file().location()).isEqualTo(delete2.location()); } + @TestTemplate + public void testViewVersionTable() throws Exception { + View view = TestViews.createSampleTestView("view"); + ViewVersionTable viewVersionTable = new ViewVersionTable(view); + + TableScan scan = viewVersionTable.newScan(); + + assertThat(scan.schema()).isEqualTo(ViewVersionTable.VIEW_VERSION_SCHEMA); Review Comment: this should have some additional checks, such as ``` List<ViewMetadataReadTask> scanTasks = Lists.newArrayList( Iterators.transform( scan.planFiles().iterator(), task -> { assertThat(task).isInstanceOf(ViewMetadataReadTask.class); return (ViewMetadataReadTask) task; })); assertThat(scanTasks).hasSize(1); ViewVersion viewVersion = viewVersionTable.operations().current().currentVersion(); assertThat(scanTasks.get(0).rows()) .containsExactly( ViewMetadataReadTask.Row.of( viewVersion.versionId(), viewVersion.schemaId(), viewVersion.timestampMillis() * 1000, viewVersion.summary(), viewVersion.defaultCatalog(), viewVersion.representations(), viewVersion.defaultNamespace().toString())); ``` Also it would be good to test scans against the version table where only one/two columns are projected -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org