diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java index 9e3aefb..11e529d 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java @@ -1470,7 +1470,10 @@ private void maskPatterns(Pattern[] patterns, String fname) throws Exception { ".*total number of created files now is.*", ".*.hive-staging.*", "pk_-?[0-9]*_[0-9]*_[0-9]*", - "fk_-?[0-9]*_[0-9]*_[0-9]*" + "fk_-?[0-9]*_[0-9]*_[0-9]*", + ".*at com\\.sun\\.proxy.*", + ".*at com\\.jolbox.*", + "org\\.apache\\.hadoop\\.hive\\.metastore\\.model\\.MConstraint@([0-9]|[a-z])*" }); private final Pattern[] partialReservedPlanMask = toPattern(new String[] { 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 3c125e0..c0d9c0c 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingMetaStoreClient.java @@ -176,13 +176,15 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl // TODO: most protocol exceptions are probably unrecoverable... throw? caughtException = (TException)t; } else if ((t instanceof MetaException) && t.getMessage().matches( - "(?s).*(JDO[a-zA-Z]*|TProtocol|TTransport)Exception.*")) { + "(?s).*(JDO[a-zA-Z]*|TProtocol|TTransport)Exception.*") && + !t.getMessage().contains("java.sql.SQLIntegrityConstraintViolationException")) { caughtException = (MetaException)t; } else { throw t; } } catch (MetaException e) { - if (e.getMessage().matches("(?s).*(IO|TTransport)Exception.*")) { + if (e.getMessage().matches("(?s).*(IO|TTransport)Exception.*") && + !e.getMessage().contains("java.sql.SQLIntegrityConstraintViolationException")) { caughtException = e; } else { throw e; 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..8d6801e 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,13 @@ 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. 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 #### +)