You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2010/02/09 20:50:21 UTC

svn commit: r908179 - in /hadoop/hive/branches/branch-0.5: CHANGES.txt ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java ql/src/test/queries/clientnegative/ambiguous_col.q ql/src/test/results/clientnegative/ambiguous_col.q.out

Author: zshao
Date: Tue Feb  9 19:50:21 2010
New Revision: 908179

URL: http://svn.apache.org/viewvc?rev=908179&view=rev
Log:
HIVE-1140. Fix incorrect ambiguous column reference error message. (Paul Yang via zshao)

Added:
    hadoop/hive/branches/branch-0.5/ql/src/test/queries/clientnegative/ambiguous_col.q
    hadoop/hive/branches/branch-0.5/ql/src/test/results/clientnegative/ambiguous_col.q.out
Modified:
    hadoop/hive/branches/branch-0.5/CHANGES.txt
    hadoop/hive/branches/branch-0.5/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java

Modified: hadoop/hive/branches/branch-0.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.5/CHANGES.txt?rev=908179&r1=908178&r2=908179&view=diff
==============================================================================
--- hadoop/hive/branches/branch-0.5/CHANGES.txt (original)
+++ hadoop/hive/branches/branch-0.5/CHANGES.txt Tue Feb  9 19:50:21 2010
@@ -472,6 +472,9 @@
     HIVE-1141. Remove recursive call in FetchOperator.getNextRow.
     (Zheng Shao via He Yongqiang)
 
+    HIVE-1140. Fix incorrect ambiguous column reference error message.
+    (Paul Yang via zshao)
+
 Release 0.4.0 -  Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hive/branches/branch-0.5/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.5/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java?rev=908179&r1=908178&r2=908179&view=diff
==============================================================================
--- hadoop/hive/branches/branch-0.5/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (original)
+++ hadoop/hive/branches/branch-0.5/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java Tue Feb  9 19:50:21 2010
@@ -1526,9 +1526,9 @@
       // child can be EXPR AS ALIAS, or EXPR.
       ASTNode child = (ASTNode) exprList.getChild(i);
       boolean hasAsClause = (!isInTransform) && (child.getChildCount() == 2);
-      
+
       // EXPR AS (ALIAS,...) parses, but is only allowed for UDTF's
-      // This check is not needed and invalid when there is a transform b/c the 
+      // This check is not needed and invalid when there is a transform b/c the
       // AST's are slightly different.
       if (!isInTransform && !isUDTF && child.getChildCount() > 2) {
         throw new SemanticException(ErrorMsg.INVALID_AS.getMsg());
@@ -1583,7 +1583,7 @@
         col_list.add(exp);
         if (!StringUtils.isEmpty(alias) &&
             (out_rwsch.get(null, colAlias) != null)) {
-          throw new SemanticException(ErrorMsg.AMBIGUOUS_COLUMN.getMsg(expr.getChild(1)));
+          throw new SemanticException(ErrorMsg.AMBIGUOUS_COLUMN.getMsg(colAlias));
         }
         out_rwsch.put(tabAlias, colAlias,
                       new ColumnInfo(getColumnInternalName(pos),

Added: hadoop/hive/branches/branch-0.5/ql/src/test/queries/clientnegative/ambiguous_col.q
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.5/ql/src/test/queries/clientnegative/ambiguous_col.q?rev=908179&view=auto
==============================================================================
--- hadoop/hive/branches/branch-0.5/ql/src/test/queries/clientnegative/ambiguous_col.q (added)
+++ hadoop/hive/branches/branch-0.5/ql/src/test/queries/clientnegative/ambiguous_col.q Tue Feb  9 19:50:21 2010
@@ -0,0 +1 @@
+FROM (SELECT key, concat(value) AS key FROM src) a SELECT a.key;

Added: hadoop/hive/branches/branch-0.5/ql/src/test/results/clientnegative/ambiguous_col.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.5/ql/src/test/results/clientnegative/ambiguous_col.q.out?rev=908179&view=auto
==============================================================================
--- hadoop/hive/branches/branch-0.5/ql/src/test/results/clientnegative/ambiguous_col.q.out (added)
+++ hadoop/hive/branches/branch-0.5/ql/src/test/results/clientnegative/ambiguous_col.q.out Tue Feb  9 19:50:21 2010
@@ -0,0 +1 @@
+FAILED: Error in semantic analysis: Ambiguous Column Reference key