Skip to content

Commit

Permalink
[spark] Fix HiveMigrator hive api version compatible issue (#3381)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzifu666 authored May 22, 2024
1 parent 2c38b03 commit 20c7a28
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,13 @@ public void renameTable(boolean ignoreIfNotExists) throws Exception {

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!");
}
}

Expand Down

0 comments on commit 20c7a28

Please sign in to comment.