Bharath Vissapragada has posted comments on this change. ( http://gerrit.cloudera.org:8080/10792 )
Change subject: IMPALA-3040: Remove cache directive before dropping a table ...................................................................... Patch Set 2: Your theory seems plausible to me > I think table is dropped concurrently with Do you know what in test_caching_ddl() is calling this drop (drop db cascade/drop table etc.) ? It does not seem to be using unique_db_fixture and runs serially. So I'm wondering what is triggering a race between load() and drop(). > Now the questions is whether listPartitionNames() returns an empty list if > the table doesn't exist. The first thing to notices is that > listPartitionNames() might throw NoSuchObjectException, so intuitively that > should happen if the table doesn't exist, which is not true. The relevant > code is at > https://github.com/apache/hive/blob/966b83e3b9123bb455572d47878601d60b86999e/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java#L4717. > The NoSuchObjectException is only thrown by fireReadTablePreEvent(), which > is some kind of hook mechanism and might be a no-op in most cases. The > backend implementation is at > https://github.com/apache/hive/blob/966b83e3b9123bb455572d47878601d60b86999e/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L3247. > It merely executes a select query which doesn't check if the table exists at > all. So yes, it will return an empty list. You are right about this. I wrote a quick HMSClient class to confirm this. Following prints 0. $javac -cp "fe/target/dependency/*" TestListPartitionNames.java $java -cp "fe/target/dependency/*":$HADOOP_CONF_DIR:. TestListPartitionNames import org.apache.hadoop.hive.metastore.HiveMetaStoreClient; import org.apache.hadoop.hive.conf.HiveConf; import java.util.List; public class TestListPartitionNames { public static void main(String[] args) throws Exception { HiveMetaStoreClient client = new HiveMetaStoreClient( new HiveConf(), null); List<String> parts = client.listPartitionNames("non_existent_db_blah_blah", "foo", (short) -1); System.out.println(parts.size()); } } -- To view, visit http://gerrit.cloudera.org:8080/10792 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id7701a499405e961456adea63f3592b43bd69170 Gerrit-Change-Number: 10792 Gerrit-PatchSet: 2 Gerrit-Owner: Tianyi Wang <[email protected]> Gerrit-Reviewer: Bharath Vissapragada <[email protected]> Gerrit-Reviewer: Tianyi Wang <[email protected]> Gerrit-Comment-Date: Wed, 27 Jun 2018 06:03:21 +0000 Gerrit-HasComments: No
