Skip to content

Commit

Permalink
Fix ArrayIndexOutOfBoundsException
Browse files Browse the repository at this point in the history
  • Loading branch information
humengyu2012 committed Sep 5, 2023
1 parent 4d3064a commit bbc5e39
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.github.rholder.retry.StopStrategies;
import com.github.rholder.retry.WaitStrategies;
import com.google.common.base.Strings;
import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.IMetaStoreClient;
import org.apache.hadoop.hive.metastore.api.AlreadyExistsException;
Expand Down Expand Up @@ -332,6 +333,9 @@ public static List<String> getPartitionPathList(HiveConf hiveConf,
public static void dropPartition(HiveConf hiveConf,
String db, String tableName, String partition)
throws TException {
if (StringUtils.isEmpty(partition)) {
return;
}
try {
RETRYER.call(() -> {
long st = System.currentTimeMillis();
Expand Down Expand Up @@ -395,6 +399,9 @@ public static Properties getHiveTableMetadata(HiveConf hiveConf, String db, Stri
public static boolean hasPartition(HiveConf hiveConf,
String db, String tableName, String partition)
throws TException {
if (StringUtils.isEmpty(partition)) {
return false;
}
try {
return (Boolean) RETRYER.call(() -> {
IMetaStoreClient client = null;
Expand Down

0 comments on commit bbc5e39

Please sign in to comment.