Wenjun7J commented on code in PR #16208:
URL: https://github.com/apache/iceberg/pull/16208#discussion_r3316977937
##########
core/src/test/java/org/apache/iceberg/TestMetadataTableScans.java:
##########
@@ -521,6 +523,33 @@ public void testPartitionsTableScanWithProjection() {
validateSingleFieldPartition(entries, 3);
}
+ @TestTemplate
+ public void testPartitionsTableReusesPartitionDataSchema() throws Exception {
+ preparePartitionedTable();
+
+ Table partitionsTable = new PartitionsTable(table);
+ StaticTableScan scan = (StaticTableScan) partitionsTable.newScan();
+ List<org.apache.avro.Schema> partitionSchemas = Lists.newArrayList();
+
+ Method partitionsMethod =
+ PartitionsTable.class.getDeclaredMethod("partitions", Table.class,
StaticTableScan.class);
+ partitionsMethod.setAccessible(true);
+ @SuppressWarnings("unchecked")
+ Iterable<PartitionsTable.Partition> partitions =
+ (Iterable<PartitionsTable.Partition>) partitionsMethod.invoke(null,
table, scan);
+ Field partitionDataField =
PartitionsTable.Partition.class.getDeclaredField("partitionData");
+ partitionDataField.setAccessible(true);
+
+ for (PartitionsTable.Partition partition : partitions) {
+ PartitionData partitionData = (PartitionData)
partitionDataField.get(partition);
+ partitionSchemas.add(partitionData.getSchema());
+ }
+
+ assertThat(partitionSchemas).hasSize(4);
Review Comment:
Done.
--
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]