This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch release-0.8
in repository https://gitbox.apache.org/repos/asf/paimon.git

commit f91a22029148bafe6322f533e288a59bab6d9d18
Author: xuzifu666 <[email protected]>
AuthorDate: Wed May 22 19:12:15 2024 +0800

    [spark] Fix HiveMigrator hive api version compatible issue (#3381)
---
 .../main/java/org/apache/paimon/hive/migrate/HiveMigrator.java   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/migrate/HiveMigrator.java
 
b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/migrate/HiveMigrator.java
index fd31ec3ec..513f7f665 100644
--- 
a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/migrate/HiveMigrator.java
+++ 
b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/migrate/HiveMigrator.java
@@ -216,8 +216,13 @@ public class HiveMigrator implements Migrator {
 
     private void checkPrimaryKey() throws Exception {
         PrimaryKeysRequest primaryKeysRequest = new 
PrimaryKeysRequest(sourceDatabase, sourceTable);
-        if (!client.getPrimaryKeys(primaryKeysRequest).isEmpty()) {
-            throw new IllegalArgumentException("Can't migrate primary key 
table yet.");
+        try {
+            if (!client.getPrimaryKeys(primaryKeysRequest).isEmpty()) {
+                throw new IllegalArgumentException("Can't migrate primary key 
table yet.");
+            }
+        } catch (Exception e) {
+            LOG.warn(
+                    "Your Hive version is low which not support 
get_primary_keys, skip primary key check firstly!");
         }
     }
 

Reply via email to