yangshangqing95 commented on code in PR #17134:
URL: https://github.com/apache/iceberg/pull/17134#discussion_r3590228361
##########
core/src/test/java/org/apache/iceberg/TestMetadataTableScans.java:
##########
@@ -1833,6 +1833,26 @@ public void testDeleteFilesTableScanOnBranch() throws
IOException {
.isEqualTo(2);
}
+ @TestTemplate
+ public void testMetadataTablesTableScan() throws IOException {
+ table.newFastAppend().appendFile(FILE_A).commit();
+
+ Table metadataTablesTable = new MetadataTablesTable(table);
+ List<String> actualTables = Lists.newArrayList();
+ try (CloseableIterable<FileScanTask> tasks =
metadataTablesTable.newScan().planFiles()) {
+ assertThat(tasks).hasSize(1);
Review Comment:
Thanks for the suggestion. I removed the assertion on the number of planned
tasks.
I may be missing something, but planFiles() returns a
CloseableIterable<FileScanTask>, so asDataTask() is available on each task
rather than directly on the returned iterable. I therefore kept a small loop
over the planned tasks and their rows, while avoiding any assumption that there
will always be exactly one task.
The test now only verifies the returned metadata table names.
--
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]