Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B347510838 for ; Mon, 30 Dec 2013 20:42:54 +0000 (UTC) Received: (qmail 34023 invoked by uid 500); 30 Dec 2013 20:42:53 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 33883 invoked by uid 500); 30 Dec 2013 20:42:53 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 33875 invoked by uid 99); 30 Dec 2013 20:42:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Dec 2013 20:42:53 +0000 X-ASF-Spam-Status: No, hits=2.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of java8964@hotmail.com designates 65.54.51.84 as permitted sender) Received: from [65.54.51.84] (HELO snt0-omc3-s47.snt0.hotmail.com) (65.54.51.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Dec 2013 20:42:46 +0000 Received: from SNT149-W9 ([65.55.90.135]) by snt0-omc3-s47.snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 30 Dec 2013 12:42:26 -0800 X-TMN: [1H95b0TEleZ7MClMKcOxKARy48tJR9Qv6z4j8AnwC/0=] X-Originating-Email: [java8964@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="_056de394-0c28-4678-8e9b-00419cb92c39_" From: java8964 To: "user@hive.apache.org" Subject: RE: HiveMetaStoreClient only sees one of my DBs ? Date: Mon, 30 Dec 2013 15:42:25 -0500 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 30 Dec 2013 20:42:26.0195 (UTC) FILETIME=[A61DE630:01CF059F] X-Virus-Checked: Checked by ClamAV on apache.org --_056de394-0c28-4678-8e9b-00419cb92c39_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Best mailing list for this question is hive=2C but I will try to give my gu= ess here anyway. If you only see 'default' database=2C most likely you are using hive 'Local= MetaStore'. For helping yourself to find out the problem=2C 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 meta= store=2C did the hive-conf folder passed to the class path of your Java pro= gram? From the following log=2C it looks like wrong hive conf files are pas= sed in: [2013-12-30 11:44:03=2C261] INFO ugi=3Dmyuser_name ip=3Dunknown-ip-addr cm= d=3Dget_all_databases=09 Yong From: teddyyyy123@gmail.com Date: Mon=2C 30 Dec 2013 11:48:55 -0800 Subject: HiveMetaStoreClient only sees one of my DBs ? To: hive-user@hadoop.apache.org if I log into my hive shell=2C do "show databases=3B" =2C I see many DBs: Logging initialized using configuration in file:/etc/hive/conf/hive-log4j.p= ropertieshive> show databases=3B=0A= =0A= OKconfconfnewdefault moneytestdbTime taken: 1.57 seconds=2C Fetched: 6 row(s) but somehow if I run the following java code using the client API=2C it onl= y shows "default"=0A= =0A= public static void main(String args[]) throws MetaException { HiveMetaS= toreClient cli =3D new HiveMetaStoreClient(new HiveConf())=3B=0A= =0A= for(String db: cli.getAllDatabases()) System.out.println(db)=3B=0A= =0A= } stence)[2013-12-30 11:44:02=2C900] INFO Validating 2 unique key(s) for tabl= e DBS (DataNucleus.Datastore.Schema)=0A= =0A= [2013-12-30 11:44:02=2C913] INFO Validating 0 foreign key(s) for table DBS = (DataNucleus.Datastore.Schema)[2013-12-30 11:44:02=2C919] INFO Validating 2= index(es) for table DBS (DataNucleus.Datastore.Schema)=0A= =0A= [2013-12-30 11:44:02=2C926] INFO Validating 1 unique key(s) for table DATAB= ASE_PARAMS (DataNucleus.Datastore.Schema)[2013-12-30 11:44:02=2C937] INFO V= alidating 1 foreign key(s) for table DATABASE_PARAMS (DataNucleus.Datastore= .Schema)=0A= =0A= [2013-12-30 11:44:02=2C942] INFO Validating 2 index(es) for table DATABASE_= PARAMS (DataNucleus.Datastore.Schema)[2013-12-30 11:44:03=2C087] INFO Liste= ner found initialisation for persistable class org.apache.hadoop.hive.metas= tore.model.MDatabase (DataNucleus.MetaData)=0A= =0A= [2013-12-30 11:44:03=2C211] INFO 0: get_all_databases (org.apache.hadoop.hi= ve.metastore.HiveMetaStore)[2013-12-30 11:44:03=2C261] INFO ugi=3Dmyuser_na= me ip=3Dunknown-ip-addr cmd=3Dget_all_databases (org.apache.hadoop.hive.m= etastore.HiveMetaStore.audit)=0A= =0A= default why is it showing only 1 db? what setttings of default are different from t= he others to enable it to be shown? also I wonder how is that HiveConf() i= nitialized ? how does it even know the hive port and config settings ? is i= t hardcoded to /etc/hive/conf/hive-site.xml ?=0A= =0A= thanksYang = --_056de394-0c28-4678-8e9b-00419cb92c39_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Best mailing list for this quest= ion is hive=2C but I will try to give my guess here anyway.

<= div>If you only see 'default' database=2C most likely you are using hive 'L= ocalMetaStore'. For helping yourself to find out the problem=2C try to find= out following information:

1) What kind of Hive m= etastore you are using? Did you configure any thing? Most widely used are D= erby or Mysql. =3B
2) If you are using a remote Hive metastor= e=2C did the hive-conf folder passed to the class path of your Java program= ? From the following log=2C it looks like wrong hive conf files are passed = in:

[2013-12-30 11:44:03=2C261] INFO ugi=3Dmyuser_= name =3B ip=3Dunknown-ip-add= r cmd=3Dget_all_databases

Yong
=


From: teddyyyy123@gmail.com
Date= : Mon=2C 30 Dec 2013 11:48:55 -0800
Subject: HiveMetaStoreClient only se= es one of my DBs ?
To: hive-user@hadoop.apache.org

if I log into my hive shell=2C do "show databases=3B" =2C I see many DBs= :

Logging initialized using configuration in file:/= etc/hive/conf/hive-log4j.properties
hive>=3B show databases=3B<= /div>=0A= =0A=
OK
conf
confnew
default
mo= ney
testdb
Time taken: 1.57 seconds=2C Fetched: 6 row(s= )


but somehow if I run the fo= llowing java code using the client API=2C it only shows "default"
=0A= =0A=
public static void mai= n(String args[]) throws MetaException {
H= iveMetaStoreClient cli =3D new HiveMetaStoreClient(new HiveConf())=3B
= =0A= =0A=
for(String db: cli.getAllDatabases())
System.out.println(db)=3B=0A= =0A=
}


stence)
[2013-12-30 11:44:02=2C900] INF= O Validating 2 unique key(s) for table DBS (DataNucleus.Datastore.Schema)=0A= =0A=
[2013-12-30 11:44:02=2C913] INFO Validating 0 foreign key(s) for table= DBS (DataNucleus.Datastore.Schema)
[2013-12-30 11:44:02=2C919] I= NFO Validating 2 index(es) for table DBS (DataNucleus.Datastore.Schema)=0A= =0A=
[2013-12-30 11:44:02=2C926] INFO Validating 1 unique key(s) for table = DATABASE_PARAMS (DataNucleus.Datastore.Schema)
[2013-12-30 11:44:= 02=2C937] INFO Validating 1 foreign key(s) for table DATABASE_PARAMS (DataN= ucleus.Datastore.Schema)
=0A= =0A=
[2013-12-30 11:44:02=2C942] INFO Validating 2 index(es) for table DATA= BASE_PARAMS (DataNucleus.Datastore.Schema)
[2013-12-30 11:44:03= =2C087] INFO Listener found initialisation for persistable class org.apache= .hadoop.hive.metastore.model.MDatabase (DataNucleus.MetaData)
=0A= =0A=
[2013-12-30 11:44:03=2C211] INFO 0: get_all_databases (org.apache.hado= op.hive.metastore.HiveMetaStore)
[2013-12-30 11:44:03=2C261] INFO= ugi=3Dmyuser_name =3B ip=3Du= nknown-ip-addr cmd=3Dget_all_data= bases (org.apache.hadoop.hive.me= tastore.HiveMetaStore.audit)
=0A= =0A=
default



<= br>


why is it showing only 1 db? wh= at setttings of default are different from the others to enable it to be sh= own?  =3Balso 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 ?
=0A= =0A=


thanks
Yang





<= /div>
= --_056de394-0c28-4678-8e9b-00419cb92c39_--