Index: ql/src/test/results/clientpositive/join0.q.out =================================================================== --- ql/src/test/results/clientpositive/join0.q.out (revision 0) +++ ql/src/test/results/clientpositive/join0.q.out (revision 0) @@ -0,0 +1,177 @@ +ABSTRACT SYNTAX TREE: + (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (< (TOK_COLREF src key) 10)))) src1) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (< (TOK_COLREF src key) 10)))) src2))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)))) + +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Alias -> Map Operator Tree: + src2:src + Filter Operator + predicate: + expr: (key < 10) + type: boolean + Select Operator + expressions: + expr: key + type: string + expr: value + type: string + Reduce Output Operator + sort order: + tag: 1 + value expressions: + expr: 0 + type: string + expr: 1 + type: string + src1:src + Filter Operator + predicate: + expr: (key < 10) + type: boolean + Select Operator + expressions: + expr: key + type: string + expr: value + type: string + Reduce Output Operator + sort order: + tag: 0 + value expressions: + expr: 0 + type: string + expr: 1 + type: string + Reduce Operator Tree: + Join Operator + condition map: + Inner Join 0 to 1 + condition expressions: + 0 {VALUE.0} {VALUE.1} + 1 {VALUE.0} {VALUE.1} + Select Operator + expressions: + expr: 0 + type: string + expr: 1 + type: string + expr: 2 + type: string + expr: 3 + type: string + File Output Operator + compressed: false + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat + + Stage: Stage-0 + Fetch Operator + limit: -1 + + +9 val_9 0 val_0 +9 val_9 4 val_4 +9 val_9 8 val_8 +9 val_9 0 val_0 +9 val_9 0 val_0 +9 val_9 5 val_5 +9 val_9 2 val_2 +9 val_9 5 val_5 +9 val_9 9 val_9 +9 val_9 5 val_5 +5 val_5 0 val_0 +5 val_5 4 val_4 +5 val_5 8 val_8 +5 val_5 0 val_0 +5 val_5 0 val_0 +5 val_5 5 val_5 +5 val_5 2 val_2 +5 val_5 5 val_5 +5 val_5 9 val_9 +5 val_5 5 val_5 +8 val_8 0 val_0 +8 val_8 4 val_4 +8 val_8 8 val_8 +8 val_8 0 val_0 +8 val_8 0 val_0 +8 val_8 5 val_5 +8 val_8 2 val_2 +8 val_8 5 val_5 +8 val_8 9 val_9 +8 val_8 5 val_5 +5 val_5 0 val_0 +5 val_5 4 val_4 +5 val_5 8 val_8 +5 val_5 0 val_0 +5 val_5 0 val_0 +5 val_5 5 val_5 +5 val_5 2 val_2 +5 val_5 5 val_5 +5 val_5 9 val_9 +5 val_5 5 val_5 +4 val_4 0 val_0 +4 val_4 4 val_4 +4 val_4 8 val_8 +4 val_4 0 val_0 +4 val_4 0 val_0 +4 val_4 5 val_5 +4 val_4 2 val_2 +4 val_4 5 val_5 +4 val_4 9 val_9 +4 val_4 5 val_5 +2 val_2 0 val_0 +2 val_2 4 val_4 +2 val_2 8 val_8 +2 val_2 0 val_0 +2 val_2 0 val_0 +2 val_2 5 val_5 +2 val_2 2 val_2 +2 val_2 5 val_5 +2 val_2 9 val_9 +2 val_2 5 val_5 +0 val_0 0 val_0 +0 val_0 4 val_4 +0 val_0 8 val_8 +0 val_0 0 val_0 +0 val_0 0 val_0 +0 val_0 5 val_5 +0 val_0 2 val_2 +0 val_0 5 val_5 +0 val_0 9 val_9 +0 val_0 5 val_5 +5 val_5 0 val_0 +5 val_5 4 val_4 +5 val_5 8 val_8 +5 val_5 0 val_0 +5 val_5 0 val_0 +5 val_5 5 val_5 +5 val_5 2 val_2 +5 val_5 5 val_5 +5 val_5 9 val_9 +5 val_5 5 val_5 +0 val_0 0 val_0 +0 val_0 4 val_4 +0 val_0 8 val_8 +0 val_0 0 val_0 +0 val_0 0 val_0 +0 val_0 5 val_5 +0 val_0 2 val_2 +0 val_0 5 val_5 +0 val_0 9 val_9 +0 val_0 5 val_5 +0 val_0 0 val_0 +0 val_0 4 val_4 +0 val_0 8 val_8 +0 val_0 0 val_0 +0 val_0 0 val_0 +0 val_0 5 val_5 +0 val_0 2 val_2 +0 val_0 5 val_5 +0 val_0 9 val_9 +0 val_0 5 val_5 Index: ql/src/test/queries/clientpositive/join0.q =================================================================== --- ql/src/test/queries/clientpositive/join0.q (revision 0) +++ ql/src/test/queries/clientpositive/join0.q (revision 0) @@ -0,0 +1,11 @@ +EXPLAIN +SELECT * FROM + (SELECT * FROM src WHERE src.key < 10) src1 + JOIN + (SELECT * FROM src WHERE src.key < 10) src2; + +SELECT * FROM + (SELECT * FROM src WHERE src.key < 10) src1 + JOIN + (SELECT * FROM src WHERE src.key < 10) src2; + Index: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (revision 723910) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (working copy) @@ -754,6 +754,8 @@ */ private void parseJoinCondition(QBJoinTree joinTree, CommonTree joinCond, Vector leftSrc) throws SemanticException { + if (joinCond == null) + return; switch (joinCond.getToken().getType()) { case HiveParser.KW_OR: @@ -2415,7 +2417,6 @@ joinTree.setFilters(filters); CommonTree joinCond = (CommonTree) joinParseTree.getChild(2); - assert joinCond != null; Vector leftSrc = new Vector(); parseJoinCondition(joinTree, joinCond, leftSrc); if (leftSrc.size() == 1)