Author: sershe
Date: Wed Mar 12 20:38:18 2014
New Revision: 1576892

URL: http://svn.apache.org/r1576892
Log:
HIVE-6538 : yet another annoying exception in test logs (Szehon Ho, reviewed by 
Sergey Shelukhin)

Modified:
    
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java

Modified: 
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java
URL: 
http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java?rev=1576892&r1=1576891&r2=1576892&view=diff
==============================================================================
--- 
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java
 (original)
+++ 
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java
 Wed Mar 12 20:38:18 2014
@@ -129,9 +129,9 @@ public class RetryingHMSHandler implemen
           // Due to reflection, the jdo exception is wrapped in
           // invocationTargetException
           caughtException = e.getCause();
-        } else if (e.getCause() instanceof NoSuchObjectException) {
+        } else if (e.getCause() instanceof NoSuchObjectException || 
e.getTargetException().getCause() instanceof NoSuchObjectException) {
           String methodName = method.getName();
-          if (!methodName.startsWith("get_table") && 
!methodName.startsWith("get_partition")) {
+          if (!methodName.startsWith("get_table") && 
!methodName.startsWith("get_partition") && 
!methodName.startsWith("get_function")) {
             LOG.error(ExceptionUtils.getStackTrace(e.getCause()));
           }
           throw e.getCause();

Modified: 
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
URL: 
http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java?rev=1576892&r1=1576891&r2=1576892&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java 
(original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java 
Wed Mar 12 20:38:18 2014
@@ -18,7 +18,6 @@
 
 package org.apache.hadoop.hive.ql.exec;
 
-import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.Method;
 import java.net.URL;
@@ -44,6 +43,8 @@ import org.apache.hadoop.hive.common.Jav
 import org.apache.hadoop.hive.common.type.HiveDecimal;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.metastore.api.Function;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
 import org.apache.hadoop.hive.ql.exec.FunctionUtils.UDFClassType;
 import org.apache.hadoop.hive.ql.metadata.Hive;
 import org.apache.hadoop.hive.ql.metadata.HiveException;
@@ -562,7 +563,10 @@ public final class FunctionRegistry {
         }
       }
     } catch (HiveException e) {
-      LOG.info("Unable to lookup UDF in metastore: " + e);
+      if (!((e.getCause() != null) && (e.getCause() instanceof MetaException)) 
&&
+         (e.getCause().getCause() != null) && (e.getCause().getCause() 
instanceof NoSuchObjectException))  {
+         LOG.info("Unable to lookup UDF in metastore: " + e);
+      }
     } catch (ClassNotFoundException e) {
       // Lookup of UDf class failed
       LOG.error("Unable to load UDF class: " + e);


Reply via email to