Best mailing list for this question is hive, but I will try to give my guess here anyway. If you only see 'default' database, most likely you are using hive 'LocalMetaStore'. For helping yourself to find out the problem, try to find out following information: 1) What kind of Hive metastore you are using? Did you configure any thing? Most widely used are Derby or Mysql. 2) If you are using a remote Hive metastore, did the hive-conf folder passed to the class path of your Java program? From the following log, it looks like wrong hive conf files are passed in: [2013-12-30 11:44:03,261] INFO ugi=myuser_name ip=unknown-ip-addr cmd=get_all_databases Yong
From: teddyyyy...@gmail.com Date: Mon, 30 Dec 2013 11:48:55 -0800 Subject: HiveMetaStoreClient only sees one of my DBs ? To: hive-u...@hadoop.apache.org if I log into my hive shell, do "show databases;" , I see many DBs: Logging initialized using configuration in file:/etc/hive/conf/hive-log4j.propertieshive> show databases; OKconfconfnewdefault moneytestdbTime taken: 1.57 seconds, Fetched: 6 row(s) but somehow if I run the following java code using the client API, it only shows "default" public static void main(String args[]) throws MetaException { HiveMetaStoreClient cli = new HiveMetaStoreClient(new HiveConf()); for(String db: cli.getAllDatabases()) System.out.println(db); } stence)[2013-12-30 11:44:02,900] INFO Validating 2 unique key(s) for table DBS (DataNucleus.Datastore.Schema) [2013-12-30 11:44:02,913] INFO Validating 0 foreign key(s) for table DBS (DataNucleus.Datastore.Schema)[2013-12-30 11:44:02,919] INFO Validating 2 index(es) for table DBS (DataNucleus.Datastore.Schema) [2013-12-30 11:44:02,926] INFO Validating 1 unique key(s) for table DATABASE_PARAMS (DataNucleus.Datastore.Schema)[2013-12-30 11:44:02,937] INFO Validating 1 foreign key(s) for table DATABASE_PARAMS (DataNucleus.Datastore.Schema) [2013-12-30 11:44:02,942] INFO Validating 2 index(es) for table DATABASE_PARAMS (DataNucleus.Datastore.Schema)[2013-12-30 11:44:03,087] INFO Listener found initialisation for persistable class org.apache.hadoop.hive.metastore.model.MDatabase (DataNucleus.MetaData) [2013-12-30 11:44:03,211] INFO 0: get_all_databases (org.apache.hadoop.hive.metastore.HiveMetaStore)[2013-12-30 11:44:03,261] INFO ugi=myuser_name ip=unknown-ip-addr cmd=get_all_databases (org.apache.hadoop.hive.metastore.HiveMetaStore.audit) default why is it showing only 1 db? what setttings of default are different from the others to enable it to be shown? also I wonder how is that HiveConf() initialized ? how does it even know the hive port and config settings ? is it hardcoded to /etc/hive/conf/hive-site.xml ? thanksYang