[
https://issues.apache.org/jira/browse/GOBBLIN-1802?focusedWorklogId=852660&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-852660
]
ASF GitHub Bot logged work on GOBBLIN-1802:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 23/Mar/23 18:13
Start Date: 23/Mar/23 18:13
Worklog Time Spent: 10m
Work Description: meethngala commented on code in PR #3663:
URL: https://github.com/apache/gobblin/pull/3663#discussion_r1146630887
##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergRegisterStep.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.data.management.copy.iceberg;
+
+import java.io.IOException;
+
+import org.apache.iceberg.TableMetadata;
+
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+
+import org.apache.gobblin.commit.CommitStep;
+
+/**
+ * {@link CommitStep} to perform Iceberg registration.
+ */
+
+@Slf4j
+@AllArgsConstructor
+public class IcebergRegisterStep implements CommitStep {
+
+ private final IcebergTable srcIcebergTable;
+ private final IcebergTable existingDestinationIcebergTable;
+
+ @Override
+ public boolean isCompleted() throws IOException {
+ return false;
+ }
+
+ @Override
+ public void execute() throws IOException {
+ TableMetadata destinationMetadata = null;
+ try {
+ destinationMetadata =
this.existingDestinationIcebergTable.accessTableMetadata();
+ } catch (IcebergTable.TableNotFoundException tnfe) {
+ log.warn("Destination TableMetadata doesn't exist because : {}" , tnfe);
Review Comment:
gotcha! Made the changes in my latest commit
##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergHiveCatalog.java:
##########
@@ -51,7 +54,10 @@ public String getCatalogUri() {
}
@Override
- protected TableOperations createTableOperations(TableIdentifier tableId) {
+ protected TableOperations createTableOperations(TableIdentifier tableId)
throws IOException {
+ if (!hc.tableExists(tableId)) {
+ throw new IcebergTable.TableNotFoundException(tableId);
+ }
Review Comment:
I agree that we shouldn't prohibit users from creating a table if it doesn't
already exist. I have added a method `tableAlreadyExists` in my latest commit
inside the `IcebergCatalog` interface and let the underlying implementation
handle the verification of the table's existence.
Issue Time Tracking
-------------------
Worklog Id: (was: 852660)
Time Spent: 1h 10m (was: 1h)
> Register iceberg table metadata update with destination side catalog
> --------------------------------------------------------------------
>
> Key: GOBBLIN-1802
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1802
> Project: Apache Gobblin
> Issue Type: New Feature
> Reporter: Meeth Gala
> Priority: Major
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)