public static String unparseIdentifier(String identifier, Quotation quotation) {
    return String.format("%s%s%s",
        quotation.getQuotationChar(),
        identifier.replaceAll(
            quotation.getQuotationChar(), quotation.getQuotationChar() + quotation.getQuotationChar()),
        quotation.getQuotationChar());
  }
Regenerate an identifier as part of unparsing it back to SQL text.
ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveUtils.java