From 508553dfb66f7276fac2ea2a7a631c262ac0cc6d Mon Sep 17 00:00:00 2001 From: CC Lien Date: Fri, 14 Feb 2014 01:56:59 +0800 Subject: [PATCH] Fix IMPALA-749. Allow to load partitions more than Short.MAX_VALUE. --- .../com/cloudera/impala/catalog/HdfsTable.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fe/src/main/java/com/cloudera/impala/catalog/HdfsTable.java b/fe/src/main/java/com/cloudera/impala/catalog/HdfsTable.java index f5321c1..0d9eef5 100644 --- a/fe/src/main/java/com/cloudera/impala/catalog/HdfsTable.java +++ b/fe/src/main/java/com/cloudera/impala/catalog/HdfsTable.java @@ -144,6 +144,9 @@ public class HdfsTable extends Table { private static final boolean SUPPORTS_VOLUME_ID; + // Indicating no partition limit in listPartition API of HiveMetaStoreClient + private static final short UNLIMITED_NUM_PARTITIONS=-1; + static { try { // call newInstance() instead of using a shared instance from a cache @@ -765,7 +768,7 @@ public class HdfsTable extends Table { Lists.newArrayList(); if (cachedEntry == null || !(cachedEntry instanceof HdfsTable) || cachedEntry.lastDdlTime_ != lastDdlTime_) { - msPartitions.addAll(client.listPartitions(db_.getName(), name_, Short.MAX_VALUE)); + msPartitions.addAll(client.listPartitions(db_.getName(), name_, UNLIMITED_NUM_PARTITIONS)); } else { // The table was already in the metadata cache and it has not been modified. Preconditions.checkArgument(cachedEntry instanceof HdfsTable); @@ -782,7 +785,7 @@ public class HdfsTable extends Table { // First get a list of all the partition names for this table from the // metastore, this is much faster than listing all the Partition objects. modifiedPartitionNames.addAll( - client.listPartitionNames(db_.getName(), name_, Short.MAX_VALUE)); + client.listPartitionNames(db_.getName(), name_, UNLIMITED_NUM_PARTITIONS)); } int totalPartitions = modifiedPartitionNames.size(); -- 1.7.9.5