List<Partition> getPartitionsWithSpecsInternal(Table tbl, GetPartitionsRequest request)
      throws HiveException, TException {

    if (!tbl.isPartitioned()) {
      throw new HiveException(ErrorMsg.TABLE_NOT_PARTITIONED, tbl.getTableName());
    }
    GetPartitionsResponse response = getMSC().getPartitionsWithSpecs(request);
    List<org.apache.hadoop.hive.metastore.api.PartitionSpec> partitionSpecs = response.getPartitionSpec();
    List<Partition> partitions = new ArrayList<>();
    partitions.addAll(convertFromPartSpec(partitionSpecs.iterator(), tbl));

    return partitions;
  }
Get a list of Partitions by filter.
@param tbl The table containing the partitions.
@param filter A string represent partition predicates.
@return a list of partitions satisfying the partition predicates.
@throws HiveException
@throws MetaException
@throws NoSuchObjectException
@throws TException
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java