@Override
  public String convertExprToFilter(byte[] exprBytes, String defaultPartitionName, boolean decodeFilterExpToStr)
      throws MetaException {
    ExprNodeDesc expr;
    try {
      expr = deserializeExpr(exprBytes);
    } catch (MetaException e) {
      // When deserializeExpr fails try to deserialize th exprBytes to string based on the
      // flag decodeFilterExpToStr. This usually happens when MSCK command is run with partition
      // filters. When MSCK command tries to drop the partitions, The string partition filter is serialized
      // to byte array and during deserialization we need to construct the filter string back.
      if (decodeFilterExpToStr) {
        return new String(exprBytes, StandardCharsets.UTF_8);
      }
      throw new MetaException(e.getMessage());
    }
    if ((defaultPartitionName != null) && (!defaultPartitionName.isEmpty())) {
      try {
        ExprNodeDescUtils.replaceNullFiltersWithDefaultPartition(expr, defaultPartitionName);
      } catch (SemanticException ex) {
        LOG.error("Failed to replace \"is null\" and \"is not null\" expression with default partition", ex);
        throw new MetaException(ex.getMessage());
      }
    }
    return expr.getExprString();
  }
The basic implementation of PartitionExpressionProxy that uses ql package classes.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartitionExpressionForMetastore.java