kmozaid commented on code in PR #6410:
URL: https://github.com/apache/iceberg/pull/6410#discussion_r1053961134


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java:
##########
@@ -198,6 +201,28 @@ public void testCreateTableTxnBuilder() throws Exception {
     }
   }
 
+  @Test
+  public void testLoadTableWithCustomMetricReporter() throws Exception {
+    Schema schema = getTestSchema();
+    TableIdentifier tableIdent = TableIdentifier.of(DB_NAME, "tbl");
+    String location = temp.newFolder("tbl").toString();
+
+    HiveCatalog catalog = new HiveCatalog();
+    catalog.initialize(
+        "hive", ImmutableMap.of("metrics-reporter-impl", 
TestMetricsReporter.class.getName()));
+    try {
+      Transaction txn =
+          catalog.buildTable(tableIdent, 
schema).withLocation(location).createTransaction();
+      txn.commitTransaction();
+      BaseTable baseTable = (BaseTable) catalog.loadTable(tableIdent);
+      Assertions.assertInstanceOf(TestMetricsReporter.class, 
baseTable.reporter());

Review Comment:
   I don't see see a way to assert that custom reporter's `report()` method is 
being called if we don't expose this field. Do we use reflection to get field 
hidden fields and assert on them?



-- 
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]

Reply via email to