This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 20c7a280e [spark] Fix HiveMigrator hive api version compatible issue
(#3381)
20c7a280e is described below
commit 20c7a280e46bc9994d00bbfaa2c5439a61e1fe6b
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 1af116cc1..a8516c3a4 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
@@ -224,8 +224,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!");
}
}