You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/03/01 08:06:00 UTC

[jira] [Work logged] (GOBBLIN-1786) Support Other Catalog Types for Iceberg Distcp

     [ https://issues.apache.org/jira/browse/GOBBLIN-1786?focusedWorklogId=848225&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-848225 ]

ASF GitHub Bot logged work on GOBBLIN-1786:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Mar/23 08:05
            Start Date: 01/Mar/23 08:05
    Worklog Time Spent: 10m 
      Work Description: meethngala commented on code in PR #3643:
URL: https://github.com/apache/gobblin/pull/3643#discussion_r1121310192


##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergCatalogFactory.java:
##########
@@ -17,20 +17,26 @@
 
 package org.apache.gobblin.data.management.copy.iceberg;
 
+import java.io.IOException;
+import java.util.Map;
+
 import org.apache.hadoop.conf.Configuration;
-import org.apache.iceberg.hive.HiveCatalog;
+import org.apache.iceberg.CatalogUtil;
+import org.apache.iceberg.catalog.Catalog;
 
-import com.google.common.collect.Maps;
+import org.apache.gobblin.util.reflection.GobblinConstructorUtils;
 
 
 /**
  * Provides an {@link IcebergCatalog}.
  */
 public class IcebergCatalogFactory {
-  public static IcebergCatalog create(Configuration configuration) {
-    HiveCatalog hcat = new HiveCatalog();
-    hcat.setConf(configuration);
-    hcat.initialize("hive", Maps.newHashMap());
-    return new IcebergHiveCatalog(hcat);
+  public static IcebergCatalog create(IcebergCatalog.CatalogSpecifier specifier, Map<String, String> properties, Configuration configuration) throws IOException {
+    try {
+      Catalog catalog = CatalogUtil.loadCatalog(specifier.getCatalogClass().getName(), specifier.getCatalogName(), properties, configuration);
+      return GobblinConstructorUtils.invokeLongestConstructor(specifier.getIcebergCatalogClass(), catalog);

Review Comment:
   I have updated the factory to invoke the exact constructor in my latest commit!





Issue Time Tracking
-------------------

    Worklog Id:     (was: 848225)
    Time Spent: 4h 40m  (was: 4.5h)

> Support Other Catalog Types for Iceberg Distcp
> ----------------------------------------------
>
>                 Key: GOBBLIN-1786
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1786
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Meeth Gala
>            Priority: Major
>          Time Spent: 4h 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)