public List<Partition> getPartitionsByFilter(Table tbl, String filter)
      throws HiveException, MetaException, NoSuchObjectException, TException {

    if (!tbl.isPartitioned()) {
      throw new HiveException(ErrorMsg.TABLE_NOT_PARTITIONED, tbl.getTableName());
    }

    List<org.apache.hadoop.hive.metastore.api.Partition> tParts = getMSC().listPartitionsByFilter(
        tbl.getDbName(), tbl.getTableName(), filter, (short)-1);
    return convertFromMetastore(tbl, tParts);
  }
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