commit bb56777eabd686fce3d5002f84d32504b7ec1970 Author: Alan Gates Date: Mon May 14 16:15:02 2018 -0700 HIVE-19531 TransactionalValidationListener is getting catalog name from conf instead of table object. diff --git standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/TransactionalValidationListener.java standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/TransactionalValidationListener.java index 80dfd301c7..42d02489b4 100644 --- standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/TransactionalValidationListener.java +++ standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/TransactionalValidationListener.java @@ -406,7 +406,7 @@ private String validateTransactionalProperties(String transactionalProperties) { } private final Pattern ORIGINAL_PATTERN = Pattern.compile("[0-9]+_[0-9]+"); /** - * @see org.apache.hadoop.hive.ql.exec.Utilities#COPY_KEYWORD + * see org.apache.hadoop.hive.ql.exec.Utilities#COPY_KEYWORD */ private static final Pattern ORIGINAL_PATTERN_COPY = Pattern.compile("[0-9]+_[0-9]+" + "_copy_" + "[0-9]+"); @@ -423,8 +423,10 @@ private void validateTableStructure(IHMSHandler hmsHandler, Table table) try { Warehouse wh = hmsHandler.getWh(); if (table.getSd().getLocation() == null || table.getSd().getLocation().isEmpty()) { + String catName = table.isSetCatName() ? table.getCatName() : + MetaStoreUtils.getDefaultCatalog(getConf()); tablePath = wh.getDefaultTablePath(hmsHandler.getMS().getDatabase( - MetaStoreUtils.getDefaultCatalog(getConf()), table.getDbName()), table.getTableName()); + catName, table.getDbName()), table.getTableName()); } else { tablePath = wh.getDnsPath(new Path(table.getSd().getLocation())); }