protected String getMatchedText(ASTNode n) {
    if (n == null) {
      return null;
    }

    quotedIdentifierHelper.visit(n);
    return ctx.getTokenRewriteStream().toString(n.getTokenStartIndex(),
        n.getTokenStopIndex() + 1).trim();
  }
This allows us to take an arbitrary ASTNode and turn it back into SQL that produced it without
needing to understand what it is (except for QuotedIdentifiers).
ql/src/java/org/apache/hadoop/hive/ql/parse/MergeSemanticAnalyzer.java