Index: ql/src/test/results/clientnegative/analyze_non_existent_tbl.q.out =================================================================== --- ql/src/test/results/clientnegative/analyze_non_existent_tbl.q.out (revision 0) +++ ql/src/test/results/clientnegative/analyze_non_existent_tbl.q.out (revision 0) @@ -0,0 +1 @@ +FAILED: SemanticException [Error 10001]: Table not found nonexistent Index: ql/src/test/queries/clientnegative/analyze_non_existent_tbl.q =================================================================== --- ql/src/test/queries/clientnegative/analyze_non_existent_tbl.q (revision 0) +++ ql/src/test/queries/clientnegative/analyze_non_existent_tbl.q (revision 0) @@ -0,0 +1 @@ +analyze table nonexistent compute statistics; Index: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (revision 1573644) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (working copy) @@ -1236,8 +1236,13 @@ sqAliasToCTEName.put(alias, cte_name); continue; } - throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(qb - .getParseInfo().getSrcForAlias(alias))); + ASTNode src = qb.getParseInfo().getSrcForAlias(alias); + if (null != src) { + throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(src)); + } else { + throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(alias)); + } + } // Disallow INSERT INTO on bucketized tables