diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index f15df05..301940d 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -1208,7 +1208,7 @@ public Type getType(String name) throws NoSuchObjectException, MetaException, TE public boolean tableExists(String databaseName, String tableName) throws MetaException, TException, UnknownDBException { try { - return filterHook.filterTable(client.get_table(databaseName, tableName)) == null; + return filterHook.filterTable(client.get_table(databaseName, tableName)) != null; } catch (NoSuchObjectException e) { return false; } diff --git a/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStorePartitionSpecs.java b/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStorePartitionSpecs.java index e48f55c..ed1a453 100644 --- a/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStorePartitionSpecs.java +++ b/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStorePartitionSpecs.java @@ -143,6 +143,8 @@ private static void createTable(HiveMetaStoreClient hmsc, boolean enablePartitio Table table = new Table(tableName, dbName, "", 0, 0, 0, storageDescriptor, partColumns, tableParameters, "", "", ""); hmsc.createTable(table); + Assert.assertTrue("Table " + dbName + "." + tableName + " does not exist", + hmsc.tableExists(dbName, tableName)); }