private boolean isValidJoinSide(ASTNode right) {
    return (right.getToken().getType() == HiveParser.TOK_TABREF)
        || (right.getToken().getType() == HiveParser.TOK_SUBQUERY)
        || (right.getToken().getType() == HiveParser.TOK_PTBLFUNCTION);
  }
Extract the filters from the join condition and push them on top of the
source operators. This procedure traverses the query tree recursively,
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java