zhangjun0x01 commented on a change in pull request #2217:
URL: https://github.com/apache/iceberg/pull/2217#discussion_r618122251



##########
File path: flink/src/main/java/org/apache/iceberg/flink/actions/Actions.java
##########
@@ -50,4 +53,34 @@ public RewriteDataFilesAction rewriteDataFiles() {
     return new RewriteDataFilesAction(env, table);
   }
 
+  /**
+   * Migrate an exist hive table into iceberg table
+   *
+   * @param flinkHiveCatalog    the HiveCatalog of flink, we get hive table 
info from this
+   * @param hiveSourceDatabaseName    source hive database name
+   * @param hiveSourceTableName source hive table name
+   * @param icebergCatalog      target iceberg catalog
+   * @param baseNamespace       target iceberg Namespace
+   * @param icebergDbName       target iceberg database name
+   * @param icebergTableName    target iceberg table name
+   * @return the MigrateAction
+   */
+  public static MigrateAction migrateHive2Iceberg(HiveCatalog 
flinkHiveCatalog, String hiveSourceDatabaseName,
+                                                  String hiveSourceTableName, 
Catalog icebergCatalog,
+                                                  Namespace baseNamespace,
+                                                  String icebergDbName, String 
icebergTableName) {
+    return 
migrateHive2Iceberg(StreamExecutionEnvironment.getExecutionEnvironment(), 
flinkHiveCatalog,
+        hiveSourceDatabaseName,
+        hiveSourceTableName, icebergCatalog, baseNamespace,
+        icebergDbName, icebergTableName);
+  }
+
+  public static MigrateAction migrateHive2Iceberg(StreamExecutionEnvironment 
env, HiveCatalog flinkHiveCatalog,
+                                                  String 
hiveSourceDatabaseName, String hiveSourceTableName,
+                                                  Catalog icebergCatalog, 
Namespace baseNamespace,
+                                                  String icebergDbName, String 
icebergTableName) {

Review comment:
       I think the `database`,`table` may be more clear for new iceberg user 
,because the `TableIdentifier ` is iceberg internal class,the user need to know 
how to construct the `TableIdentifier`,what do you think?




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