diff --git metastore/src/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java metastore/src/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java index 2fc487f..e46b50d 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java @@ -200,9 +200,9 @@ public Result invokeInternal(final Object proxy, final Method method, final Obje if (retryCount >= retryLimit) { LOG.error("HMSHandler Fatal error: " + ExceptionUtils.getStackTrace(caughtException)); - // Since returning exceptions with a nested "cause" can be a problem in - // Thrift, we are stuffing the stack trace into the message itself. - throw new MetaException(ExceptionUtils.getStackTrace(caughtException)); + MetaException me = new MetaException(caughtException.getMessage()); + me.initCause(caughtException); + throw me; } assert (retryInterval >= 0); diff --git ql/src/test/results/clientnegative/create_with_constraints_duplicate_name.q.out ql/src/test/results/clientnegative/create_with_constraints_duplicate_name.q.out index 8d6801e..989ff38 100644 --- ql/src/test/results/clientnegative/create_with_constraints_duplicate_name.q.out +++ ql/src/test/results/clientnegative/create_with_constraints_duplicate_name.q.out @@ -10,13 +10,4 @@ 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:javax.jdo.JDOUserException: One or more instances could not be made persistent -#### A masked pattern was here #### -NestedThrowablesStackTrace: -Insert of object "#### A masked pattern was here ####" using statement "INSERT INTO KEY_CONSTRAINTS (CHILD_CD_ID,CHILD_INTEGER_IDX,CHILD_TBL_ID,CONSTRAINT_TYPE,DELETE_RULE,ENABLE_VALIDATE_RELY,PARENT_CD_ID,PARENT_INTEGER_IDX,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 "#### A masked pattern was here ####" using statement "INSERT INTO KEY_CONSTRAINTS (CHILD_CD_ID,CHILD_INTEGER_IDX,CHILD_TBL_ID,CONSTRAINT_TYPE,DELETE_RULE,ENABLE_VALIDATE_RELY,PARENT_CD_ID,PARENT_INTEGER_IDX,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 #### -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 #### -) +FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:One or more instances could not be made persistent)