hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1625183 - /hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java
Date Mon, 15 Sep 2014 23:20:43 GMT
Author: hashutosh
Date: Mon Sep 15 23:20:43 2014
New Revision: 1625183

URL: http://svn.apache.org/r1625183
Log:
HIVE-8039 : [CBO] Handle repeated alias (Ashutosh Chauhan via John Pullokkaran)

Modified:
    hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java?rev=1625183&r1=1625182&r2=1625183&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/RowResolver.java Mon Sep
15 23:20:43 2014
@@ -49,7 +49,7 @@ public class RowResolver implements Seri
    * The primary(first) mapping is still only held in
    * invRslvMap.
    */
-  private Map<String, String[]> altInvRslvMap;
+  private final Map<String, String[]> altInvRslvMap;
   private  Map<String, ASTNode> expressionMap;
 
   // TODO: Refactor this and do in a more object oriented manner
@@ -377,10 +377,11 @@ public class RowResolver implements Seri
 
       outputColPos++;
 
-      if (rrToAddTo.get(tabAlias, colAlias) != null)
-        throw new RuntimeException("Ambigous Column Names");
-
-      rrToAddTo.put(tabAlias, colAlias, newCI);
+      if (rrToAddTo.get(tabAlias, colAlias) != null) {
+        LOG.debug("Found duplicate column alias in RR: " + rrToAddTo.get(tabAlias, colAlias));
+      } else {
+        rrToAddTo.put(tabAlias, colAlias, newCI);
+      }
 
       qualifiedColName = rrToAddFrom.getAlternateMappings(cInfoFrmInput
           .getInternalName());
@@ -403,7 +404,7 @@ public class RowResolver implements Seri
 	/**
 	 * Return a new row resolver that is combination of left RR and right RR.
 	 * The schema will be schema of left, schema of right
-	 * 
+	 *
 	 * @param leftRR
 	 * @param rightRR
 	 * @return



Mime
View raw message