public boolean generateSqlFilterForPushdown(String catName, String dbName, String tableName,
      List<FieldSchema> partitionKeys, ExpressionTree tree, String defaultPartitionName,
      SqlFilterForPushdown result) throws MetaException {
    // Derby and Oracle do not interpret filters ANSI-properly in some cases and need a workaround.
    assert partitionKeys != null;
    boolean dbHasJoinCastBug = dbType.hasJoinOperationOrderBug();
    result.tableName = tableName;
    result.dbName = dbName;
    result.catName = catName;
    result.filter = PartitionFilterGenerator.generateSqlFilter(catName, dbName, tableName,
        partitionKeys, tree, result.params, result.joins, dbHasJoinCastBug,
        ((defaultPartitionName == null) ? defaultPartName : defaultPartitionName),
        dbType, schema, result.compactJoins);
    return result.filter != null;
  }
This method can be used to return "partially-filled" partitions when clients are only interested in
some fields of the Partition objects. The partitionFields parameter is a list of dot separated
partition field names. For example, if a client is interested in only partition location,
serializationLib, values and parameters it can specify sd.location, sd.serdeInfo.serializationLib,
values, parameters in the partitionFields list. In such a case all the returned partitions will have
only the requested fields set and the rest of the fields will remain unset. The implementation of this method
runs queries only for the fields which are requested and pushes down the projection to the database to improve
performance.

@param tbl                    Table whose partitions are being requested
@param partitionFields        List of dot separated field names. Each dot separated string represents nested levels. For
                              instance sd.serdeInfo.serializationLib represents the serializationLib field of the StorageDescriptor
                              for a the partition
@param includeParamKeyPattern The SQL regex pattern which is used to include the parameter keys. Can include _ or %
                              When this pattern is set, only the partition parameter key-value pairs where the key matches
                              the pattern will be returned. This is applied in conjunction with excludeParamKeyPattern if it is set.
@param excludeParamKeyPattern The SQL regex paterrn which is used to exclude the parameter keys. Can include _ or %
                              When this pattern is set, all the partition parameters where key is NOT LIKE the pattern
                              are returned. This is applied in conjunction with the includeParamKeyPattern if it is set.
@param filterSpec             The filterSpec from <code>GetPartitionsRequest</code> which includes the filter mode (BY_EXPR, BY_VALUES or BY_NAMES)
                              and the list of filter strings to be used to filter the results
@param filter                 SqlFilterForPushDown which is set in the <code>canUseDirectSql</code> method before this method is called.
                              The filter is used only when the mode is BY_EXPR
@return
@throws MetaException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java