Skip to content

Conversation

@kmozaid
Copy link
Contributor

@kmozaid kmozaid commented Dec 12, 2022

No description provided.

@nastra
Copy link
Contributor

nastra commented Dec 20, 2022

@kmozaid now that #6404 is merged, can you please rebase this PR?

@github-actions github-actions bot removed the API label Dec 21, 2022
@kmozaid
Copy link
Contributor Author

kmozaid commented Dec 21, 2022

@kmozaid now that #6404 is merged, can you please rebase this PR?

Hi @nastra I have rebased and updated PR with feedbacks.

@kmozaid kmozaid requested review from gaborkaszab and nastra and removed request for gaborkaszab and nastra December 21, 2022 12:59
Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For testing the custom metrics reporter it would be good to add the following test to TestJdbcCatalog:

+  @Test
+  public void testCatalogWithCustomMetricsReporter() throws IOException {
+    catalog =
+        initCatalog(
+            "test_jdbc_catalog_with_custom_reporter",
+            ImmutableMap.of(
+                CatalogProperties.METRICS_REPORTER_IMPL, CustomMetricsReporter.class.getName()));
+
+    catalog.buildTable(TABLE, SCHEMA).create();
+    Table table = catalog.loadTable(TABLE);
+    table
+        .newFastAppend()
+        .appendFile(
+            DataFiles.builder(PartitionSpec.unpartitioned())
+                .withPath("/path/to/data-a.parquet")
+                .withFileSizeInBytes(10)
+                .withRecordCount(2)
+                .build())
+        .commit();
+
+    try (CloseableIterable<FileScanTask> tasks = table.newScan().planFiles()) {
+      assertThat(tasks.iterator()).hasNext();
+    }
+
+    // counter of custom metrics reporter should have been increased
+    // 1x for commit metrics / 1x for scan metrics
+    assertThat(CustomMetricsReporter.COUNTER.get()).isEqualTo(2);
+  }
+
+  public static class CustomMetricsReporter implements MetricsReporter {
+    static final AtomicInteger COUNTER = new AtomicInteger(0);
+
+    @Override
+    public void report(MetricsReport report) {
+      COUNTER.incrementAndGet();
+    }
+  }

@nastra
Copy link
Contributor

nastra commented Dec 21, 2022

@kmozaid while reviewing this PR I've noticed that not every catalog actually exposes its properties (including the JDBC catalog which I suggested above to use for testing). I've opened #6471 to address that

@kmozaid kmozaid requested a review from nastra December 21, 2022 17:05
Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some nits.
@rdblue could you review this one please?

@nastra nastra requested a review from rdblue December 21, 2022 17:11
@kmozaid
Copy link
Contributor Author

kmozaid commented Dec 23, 2022

Can I please get another review for merge to get enabled?

Copy link

@PraveenNanda124 PraveenNanda124 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@kmozaid
Copy link
Contributor Author

kmozaid commented Jan 4, 2023

@gaborkaszab Can you please get this merged?

@gaborkaszab
Copy link
Collaborator

@gaborkaszab Can you please get this merged?

The patch LGTM, however, I won't be able to merge as I'm not a committer. cc @rdblue

@szehon-ho
Copy link
Member

I think its fine with me if we can fix the failures

@kmozaid
Copy link
Contributor Author

kmozaid commented Feb 3, 2023

@gaborkaszab @szehon-ho Could you please trigger workflows?

@nastra
Copy link
Contributor

nastra commented Feb 5, 2023

@kmozaid could you rebase the PR please?
@danielcweeks could you review this please when you get a chance (and also trigger CI)?

@nastra nastra requested a review from danielcweeks February 5, 2023 09:09
@kmozaid
Copy link
Contributor Author

kmozaid commented Feb 6, 2023

@nastra I have rebased PR.

}

@Override
protected Map<String, String> properties() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused, because the changes in this file should be gone after a rebase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I didn't build locally.
thanks, I agree it should be gone. Fixed it.

@szehon-ho szehon-ho merged commit 03443f5 into apache:master Feb 9, 2023
@szehon-ho
Copy link
Member

Merged, thanks @kmozaid , also @nastra , @gaborkaszab , @PraveenNanda124 for reviews

krvikash pushed a commit to krvikash/iceberg that referenced this pull request Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants