FANNG1 commented on code in PR #8189:
URL: https://github.com/apache/gravitino/pull/8189#discussion_r2297512350


##########
iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/ClosableHiveCatalog.java:
##########
@@ -60,4 +72,64 @@ public void close() throws IOException {
           }
         });
   }
+
+  @FunctionalInterface
+  interface Executable<R> {
+    R run() throws Exception;
+  }
+
+  public <R> R execute(Executable<R> runnable) {
+    try {
+      return runnable.run();
+    } catch (Exception e) {
+      LOGGER.error("Failed to execute runnable: {}", runnable, e);
+      throw new RuntimeException(e);
+    }
+  }
+
+  public Catalog.TableBuilder buildTable(TableIdentifier identifier, Schema 
schema) {

Review Comment:
   @agnes-xinyi-lu yes, this solutino is not so general, we'd better make the 
impersonation more extensible.  @yuqi1129 , how about closing this PR since we 
didn't use this solution.



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