meethngala commented on code in PR #3560:
URL: https://github.com/apache/gobblin/pull/3560#discussion_r972531406


##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergDatasetFinder.java:
##########
@@ -53,37 +54,39 @@ public class IcebergDatasetFinder implements 
IterableDatasetFinder<IcebergDatase
   public List<IcebergDataset> findDatasets() throws IOException {
     List<IcebergDataset> matchingDatasets = new ArrayList<>();
     /*
-     * Both Iceberg database name and table name are mandatory,
-     * since we are currently only supporting Hive Catalog based Iceberg 
tables.
-     * The design will support defaults and other catalogs in future releases.
+     * Both Iceberg database name and table name are mandatory based on 
current implementation.
+     * Later we may explore supporting datasets similar to Hive
      */
-    if (properties.getProperty(ICEBERG_DB_NAME) == null || 
properties.getProperty(ICEBERG_TABLE_NAME) == null) {
-      throw new IOException("Iceberg database name or Iceberg table name is 
missing");
+    if (StringUtils.isNotBlank(properties.getProperty(ICEBERG_DB_NAME)) || 
StringUtils.isNotBlank(properties.getProperty(ICEBERG_TABLE_NAME))) {
+      throw new IllegalArgumentException(String.format("Iceberg database name: 
{%s} or Iceberg table name: {%s} is missing",
+          ICEBERG_DB_NAME, ICEBERG_TABLE_NAME));
     }
     this.dbName = properties.getProperty(ICEBERG_DB_NAME);
     this.tblName = properties.getProperty(ICEBERG_TABLE_NAME);
 
     Configuration configuration = 
HadoopUtils.getConfFromProperties(properties);
 
     IcebergCatalog icebergCatalog = 
IcebergCatalogFactory.create(configuration);
-    IcebergTable icebergTable = icebergCatalog.openTable(dbName, tblName);
-    // Currently, we only support one dataset per iceberg table
-    matchingDatasets.add(createIcebergDataset(dbName, tblName, icebergTable, 
properties, fs));
+    /* Currently, we only support one dataset per iceberg table
+     * Error handling and verification of table existence will be included as 
part IcebergTable.getCurrentSnapshotInfo() in future releases.

Review Comment:
   added a TODO for next iteration



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

Reply via email to