rdblue commented on a change in pull request #1870:
URL: https://github.com/apache/iceberg/pull/1870#discussion_r536906293



##########
File path: core/src/main/java/org/apache/iceberg/hadoop/JdbcTableOperations.java
##########
@@ -0,0 +1,113 @@
+/*
+ * 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.iceberg.hadoop;
+
+import java.sql.SQLException;
+import java.util.Objects;
+import org.apache.commons.dbutils.QueryRunner;
+import org.apache.iceberg.BaseMetastoreTableOperations;
+import org.apache.iceberg.TableMetadata;
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.iceberg.exceptions.CommitFailedException;
+import org.apache.iceberg.exceptions.NoSuchTableException;
+import org.apache.iceberg.io.FileIO;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+class JdbcTableOperations extends BaseMetastoreTableOperations {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(JdbcTableOperations.class);
+  private final String catalogName;
+  private final TableIdentifier tableIdentifier;
+  private final FileIO fileIO;
+  private QueryRunner queryRunner;
+
+  protected JdbcTableOperations(QueryRunner queryRunner, FileIO fileIO, String 
catalogName,
+                                TableIdentifier tableIdentifier) {
+    this.queryRunner = queryRunner;
+    this.catalogName = catalogName;
+    this.tableIdentifier = tableIdentifier;
+    this.fileIO = fileIO;
+  }
+
+  // The doRefresh method should provide implementation on how to get the 
metadata location
+  @Override
+  public void doRefresh() {
+    String metadataLocation = null;
+    JdbcTableDao tableDao = new JdbcTableDao(queryRunner, catalogName);
+    JdbcTable table = null;
+    try {
+      table = tableDao.get(tableIdentifier);
+    } catch (SQLException throwables) {
+      LOG.debug("Table not found: {} , {}!", tableIdentifier, throwables);

Review comment:
       This doesn't look quite right because the exception is too generic to 
simply ignore and move on.
   
   Also, no need to add a format argument for the exception. SLF4J loggers will 
detect that the last argument is an exception and add it properly without a 
placeholder for it.




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to