public static String getKeywords(Set<String> excludes) {
    StringBuilder sb = new StringBuilder();
    for (Field f : HiveLexer.class.getDeclaredFields()) {
      if (!Modifier.isStatic(f.getModifiers())) {
        continue;
      }
      String name = f.getName();
      if (!name.startsWith("KW_")) {
        continue;
      }
      name = name.substring(3);
      if (excludes != null && excludes.contains(name)) {
        continue;
      }
      if (sb.length() > 0) {
        sb.append(",");
      }
      sb.append(name);
    }
    return sb.toString();
  }
Replaces a spurious TOK_SETCOLREF added by parser with column names referring to the query
in e.g. a union. This is to maintain the expectations that some code, like order by position
alias, might have about not having ALLCOLREF. If it cannot find the columns with confidence
it will just replace SETCOLREF with ALLCOLREF. Most of the cases where that happens are
easy to work around in the query (e.g. by adding column aliases in the union).
@param setCols TOK_SETCOLREF ASTNode.
@param searcher AST searcher to reuse.
ql/src/java/org/apache/hadoop/hive/ql/parse/ParseUtils.java