kmozaid commented on code in PR #6410:
URL: https://github.com/apache/iceberg/pull/6410#discussion_r1046012714
##########
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();
Review Comment:
I don't think, its necessary to use transaction. Let me change it.
##########
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:
sure.
--
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]