private String makeQueryFilterString(String catName, String dbName, String tblName,
                                       ExpressionTree tree, Map<String, Object> params,
                                       boolean isValidatedFilter, List<FieldSchema> partitionKeys) throws MetaException {
    assert tree != null;
    FilterBuilder queryBuilder = new FilterBuilder(isValidatedFilter);
    queryBuilder.append("table.tableName == t1 && table.database.name == t2 && table.database.catalogName == t3");
    params.put("t1", tblName);
    params.put("t2", dbName);
    params.put("t3", catName);
    tree.accept(new ExpressionTree.JDOFilterGenerator(getConf(), partitionKeys, queryBuilder, params));
    if (queryBuilder.hasError()) {
      assert !isValidatedFilter;
      LOG.debug("JDO filter pushdown cannot be used: {}", queryBuilder.getErrorMessage());
      return null;
    }
    String jdoFilter = queryBuilder.getFilter();
    LOG.debug("jdoFilter = {}", jdoFilter);
    return jdoFilter;
  }
Makes a JDO query filter string for tables or partitions.
@param dbName Database name.
@param table Table. If null, the query returned is over tables in a database.
  If not null, the query returned is over partitions in a table.
@param tree The expression tree from which JDOQL filter will be made.
@param params Parameters for the filter. Some parameters may be added here.
@param isValidatedFilter Whether the filter was pre-validated for JDOQL pushdown
  by the client; if it was and we fail to create a filter, we will throw.
@return Resulting filter. Can be null if isValidatedFilter is false, and there was error.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java