public Set<Partition> getAllPartitions(Table tbl) throws HiveException {
    if (!tbl.isPartitioned()) {
      return Sets.newHashSet(new Partition(tbl));
    }
    Set<Partition> parts = Sets.newLinkedHashSet();
    if (tbl.hasNonNativePartitionSupport()) {
      parts.addAll(tbl.getStorageHandler().getPartitions(tbl));
    } else {
      List<org.apache.hadoop.hive.metastore.api.Partition> tParts;
      try {
        tParts = getMSC().listPartitions(tbl.getDbName(), tbl.getTableName(), (short) -1);
      } catch (Exception e) {
        LOG.error("Failed getAllPartitionsOf", e);
        throw new HiveException(e);
      }
      for (org.apache.hadoop.hive.metastore.api.Partition tpart : tParts) {
        parts.add(new Partition(tbl, tpart));
      }
    }
    return parts;
  }
Get all the partitions; unlike {@link #getPartitions(Table)}, does not include auth.
@param tbl table for which partitions are needed
@return list of partition objects
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java