@Override
      protected boolean canUseDirectSql(GetHelper<List<Partition>> ctx) throws MetaException {
        if (filterSpec.isSetFilterMode() && filterSpec.getFilterMode().equals(PartitionFilterMode.BY_EXPR)) {
          // if the filter mode is BY_EXPR initialize the filter and generate the expression tree
          // if there are more than one filter string we AND them together
          initExpressionTree();
          return directSql.generateSqlFilterForPushdown(table.getCatName(), table.getDbName(), table.getTableName(),
                  table.getPartitionKeys(), tree, null, filter);
        }
        // BY_VALUES and BY_NAMES are always supported
        return true;
      }
GetHelper for returning db info using directSql/JDO.
@param dbName The Database Name
@param allowSql Whether or not we allow DirectSQL to perform this query.
@param allowJdo Whether or not we allow ORM to perform this query.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java