Author: hashutosh
Date: Sat Oct 11 15:29:09 2014
New Revision: 1631064

URL: http://svn.apache.org/r1631064
Log:
HIVE-8421 : [CBO] Use OptiqSemanticException in error conditions (Ashutosh 
Chauhan via Sergey Shelukhin)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java

Modified: 
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
URL: 
http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java?rev=1631064&r1=1631063&r2=1631064&view=diff
==============================================================================
--- 
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 
(original)
+++ 
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 
Sat Oct 11 15:29:09 2014
@@ -12423,7 +12423,7 @@ public class SemanticAnalyzer extends Ba
                   + " does not have the field " + field));
         }
         if (!lInfo.getInternalName().equals(rInfo.getInternalName())) {
-          throw new SemanticException(generateErrorMessage(tabref,
+          throw new OptiqSemanticException(generateErrorMessage(tabref,
               "Schema of both sides of union should match: field " + field + 
":"
                   + " appears on the left side of the UNION at column 
position: "
                   + getPositionFromInternalName(lInfo.getInternalName())
@@ -12435,7 +12435,7 @@ public class SemanticAnalyzer extends Ba
         TypeInfo commonTypeInfo = 
FunctionRegistry.getCommonClassForUnionAll(lInfo.getType(),
             rInfo.getType());
         if (commonTypeInfo == null) {
-          throw new SemanticException(generateErrorMessage(tabref,
+          throw new OptiqSemanticException(generateErrorMessage(tabref,
               "Schema of both sides of union should match: Column " + field + 
" is of type "
                   + lInfo.getType().getTypeName() + " on first table and type "
                   + rInfo.getType().getTypeName() + " on second table"));
@@ -13293,7 +13293,7 @@ public class SemanticAnalyzer extends Ba
                 grpbyExpr, new TypeCheckCtx(groupByInputRowResolver));
             ExprNodeDesc grpbyExprNDesc = astToExprNDescMap.get(grpbyExpr);
             if (grpbyExprNDesc == null)
-              throw new RuntimeException("Invalid Column Reference: " + 
grpbyExpr.dump());
+              throw new OptiqSemanticException("Invalid Column Reference: " + 
grpbyExpr.dump());
 
             addToGBExpr(groupByOutputRowResolver, groupByInputRowResolver, 
grpbyExpr,
                 grpbyExprNDesc, gbExprNDescLst, outputColumnNames);


Reply via email to