diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java b/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java index f672adf..99f599f 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java @@ -182,9 +182,9 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl } } catch (MetaException e) { if (e.getMessage().matches("(?s).*(IO|TTransport)Exception.*")) { - caughtException = e; + caughtException = caughtException == null ? e : new TException(e.getMessage() + "\n" + caughtException.getMessage()); } else { - throw e; + throw caughtException == null ? e : new TException(e.getMessage() + "\n" + caughtException.getMessage()); } } diff --git a/ql/src/test/results/clientnegative/create_with_constraints_duplicate_name.q.out b/ql/src/test/results/clientnegative/create_with_constraints_duplicate_name.q.out index 20f5d30..b7e089e 100644 --- a/ql/src/test/results/clientnegative/create_with_constraints_duplicate_name.q.out +++ b/ql/src/test/results/clientnegative/create_with_constraints_duplicate_name.q.out @@ -10,4 +10,36 @@ PREHOOK: query: create table t2(x int, constraint pk1 primary key (x) disable no PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@t2 -FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:For direct MetaStore DB connections, we don't support retries at the client level.) +FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. org.apache.thrift.TException: For direct MetaStore DB connections, we don't support retries at the client level. +javax.jdo.JDOUserException: One or more instances could not be made persistent +#### A masked pattern was here #### + at com.sun.proxy.$Proxy24.createTableWithConstraints(Unknown Source) +#### A masked pattern was here #### + at com.sun.proxy.$Proxy26.create_table_with_constraints(Unknown Source) +#### A masked pattern was here #### + at com.sun.proxy.$Proxy27.createTableWithConstraints(Unknown Source) +#### A masked pattern was here #### +NestedThrowablesStackTrace: +Insert of object "org.apache.hadoop.hive.metastore.model.MConstraint@5d06e947" using statement "INSERT INTO KEY_CONSTRAINTS (CHILD_CD_ID,CHILD_TBL_ID,CONSTRAINT_TYPE,DELETE_RULE,ENABLE_VALIDATE_RELY,PARENT_CD_ID,PARENT_TBL_ID,UPDATE_RULE,"CONSTRAINT_NAME","POSITION") VALUES (?,?,?,?,?,?,?,?,?,?)" failed : The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'KEY_CONSTRAINTS_PK' defined on 'KEY_CONSTRAINTS'. +org.datanucleus.exceptions.NucleusDataStoreException: Insert of object "org.apache.hadoop.hive.metastore.model.MConstraint@5d06e947" using statement "INSERT INTO KEY_CONSTRAINTS (CHILD_CD_ID,CHILD_TBL_ID,CONSTRAINT_TYPE,DELETE_RULE,ENABLE_VALIDATE_RELY,PARENT_CD_ID,PARENT_TBL_ID,UPDATE_RULE,"CONSTRAINT_NAME","POSITION") VALUES (?,?,?,?,?,?,?,?,?,?)" failed : The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'KEY_CONSTRAINTS_PK' defined on 'KEY_CONSTRAINTS'. +#### A masked pattern was here #### + at com.sun.proxy.$Proxy24.createTableWithConstraints(Unknown Source) +#### A masked pattern was here #### + at com.sun.proxy.$Proxy26.create_table_with_constraints(Unknown Source) +#### A masked pattern was here #### + at com.sun.proxy.$Proxy27.createTableWithConstraints(Unknown Source) +#### A masked pattern was here #### + at com.jolbox.bonecp.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:205) +#### A masked pattern was here #### +Nested Throwables StackTrace: +java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'KEY_CONSTRAINTS_PK' defined on 'KEY_CONSTRAINTS'. +#### A masked pattern was here #### + at com.jolbox.bonecp.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:205) +#### A masked pattern was here #### + at com.sun.proxy.$Proxy24.createTableWithConstraints(Unknown Source) +#### A masked pattern was here #### + at com.sun.proxy.$Proxy26.create_table_with_constraints(Unknown Source) +#### A masked pattern was here #### + at com.sun.proxy.$Proxy27.createTableWithConstraints(Unknown Source) +#### A masked pattern was here #### +