private PartitionsByExprRequest buildPartitionByExprRequest(Table tbl, byte[] exprBytes, String defaultPartitionName,
                                                              HiveConf conf, String validWriteIdList) {
    PartitionsByExprRequest req = new PartitionsByExprRequest(tbl.getDbName(), tbl.getTableName(),
            ByteBuffer.wrap(exprBytes));
    if (defaultPartitionName != null) {
      req.setDefaultPartitionName(defaultPartitionName);
    }
    req.setCatName(getDefaultCatalog(conf));
    req.setValidWriteIdList(validWriteIdList);
    req.setId(tbl.getTTable().getId());

    return req;
  }
Get a list of Partitions by expr.
@param tbl The table containing the partitions.
@param expr A serialized expression for partition predicates.
@param conf Hive config.
@param partitions the resulting list of partitions
@return whether the resulting list contains partitions which may or may not match the expr
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java