JingsongLi commented on code in PR #1897:
URL: https://github.com/apache/incubator-paimon/pull/1897#discussion_r1308170117


##########
paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkUtils.java:
##########
@@ -29,4 +44,112 @@ public static IOManager createIOManager() {
         String[] localDirs = 
SparkEnv.get().blockManager().diskBlockManager().localDirsString();
         return new IOManagerImpl(localDirs);
     }
+
+    /** This mimics a class inside of Spark which is private inside of 
LookupCatalog. */
+    public static class CatalogAndIdentifier {
+        private final CatalogPlugin catalog;
+        private final Identifier identifier;
+
+        public CatalogAndIdentifier(Pair<CatalogPlugin, Identifier> 
identifier) {
+            this.catalog = identifier.getLeft();
+            this.identifier = identifier.getRight();
+        }
+
+        public CatalogPlugin catalog() {
+            return catalog;
+        }
+
+        public Identifier identifier() {
+            return identifier;
+        }
+    }
+
+    /**
+     * A modified version of Spark's 
LookupCatalog.CatalogAndIdentifier.unapply Attempts to find the
+     * catalog and identifier a multipart identifier represents.
+     *
+     * @param nameParts Multipart identifier representing a table
+     * @return The CatalogPlugin and Identifier for the table
+     */
+    public static <C, T> Pair<C, T> catalogAndIdentifier(
+            List<String> nameParts,
+            Function<String, C> catalogProvider,
+            BiFunction<String[], String, T> identiferProvider,

Review Comment:
   identifierProvider



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