private List<String> getPartitionNames(Table tbl) throws HiveException {
    List<String> partNames;
    ExprNodeDesc predicate = desc.getCond();
    if (desc.getPartSpec() != null) {
      List<FieldSchema> fieldSchemas = tbl.getPartitionKeys();
      Map<String, String> colTypes = new HashMap<String, String>();
      for (FieldSchema fs : fieldSchemas) {
        colTypes.put(fs.getName().toLowerCase(), fs.getType());
      }
      for (Map.Entry<String, String> entry : desc.getPartSpec().entrySet()) {
        String type = colTypes.get(entry.getKey().toLowerCase());
        PrimitiveTypeInfo pti = TypeInfoFactory.getPrimitiveTypeInfo(type);
        Object val = entry.getValue();
        if (!pti.equals(TypeInfoFactory.stringTypeInfo)) {
          Object converted = ObjectInspectorConverters.getConverter(
              TypeInfoUtils.getStandardJavaObjectInspectorFromTypeInfo(TypeInfoFactory.stringTypeInfo),
              TypeInfoUtils.getStandardJavaObjectInspectorFromTypeInfo(pti))
              .convert(val);
          if (converted == null) {
            throw new HiveException("Cannot convert to " + type + " from string, value: " + val);
          }
          val = converted;
        }
        List<ExprNodeDesc> children = new ArrayList<ExprNodeDesc>();
        children.add(new ExprNodeColumnDesc(pti, entry.getKey().toLowerCase(), null, true));
        children.add(new ExprNodeConstantDesc(pti, val));
        ExprNodeDesc exprNodeDesc = ExprNodeGenericFuncDesc.newInstance(new GenericUDFOPEqual(), children);
        predicate = (predicate == null) ? exprNodeDesc :
            ExprNodeDescUtils.mergePredicates(exprNodeDesc, predicate);
      }
    }

    partNames = context.getDb().getPartitionNames(tbl, (ExprNodeGenericFuncDesc) predicate,
        desc.getOrder(), desc.getLimit());
    return partNames;
  }
Operation process of showing the partitions of a table.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/show/ShowPartitionsOperation.java