Hi ,

I can run query over hive through hive shell and using jdbc connection.

But, I got the below error, When i tried to access the hive metadata using
hive api.

java.lang.IllegalArgumentException: URI:  does not have a scheme
    at
org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:127)
    at
org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:92)

*Source Code : *
HiveConf conf;
conf=new HiveConf();
conf.addResource("/home/ankit/hive-0.7.1-bin/conf/hive-default.xml");
HiveMetaStoreClient hiveMetastoreClient;
   try {
        hiveMetastoreClient = new HiveMetaStoreClient(conf);
        List<String> list=hiveMetastoreClient.getAllDatabases();
        System.out.println("LIST : "+list);
    } catch (Exception e) {
        e.printStackTrace();

hive-default.xml :

<property>
  <name>hive.metastore.local</name>
  <value>true</value>
  <description>controls whether to connect to remove metastore server or
open a new metastore server in Hive Client JVM</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionURL</name>

<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
  <description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  <description>Driver class name for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>root</value>
  <description>username to use against metastore database</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>password</value>
</property>

Thanks,
Ankit Jain


On Wed, Oct 19, 2011 at 4:43 PM, Chinna Rao Lalam 72745 <
chinna...@huawei.com> wrote:

> Hi,
>
>  Check where u have configured some value to the "hive.metastore.uris"
> property in hive-default.xml or hive-site.xml
> and whether it is valid or not
>
>
> Hope it helps
> Chinna Rao Lalam
>  ----- Original Message -----
> From: kiranprasad <kiranprasa...@imimobile.com>
> Date: Wednesday, October 19, 2011 3:08 pm
> Subject: Re: When trying to create table Iam getting exception
> To: user@hive.apache.org
>
> >
> > Below mentioned is the table which I ve tried to create.
> >
> > $ bin/hive
> > Hive history
> >
> file=/tmp/kiranprasad.g/hive_job_log_kiranprasad.g_201110191249_2139146680.txt
> > hive> CREATE TABLE arpu (msisdn INT, arpu INT) ROW FORMAT
> > DELIMITED FIELDS
> > TERMINATED BY ',' STORED AS TEXTFILE;
> > FAILED: Error in metadata: java.lang.IllegalArgumentException:
> > URI:  does
> > not have a scheme
> > FAILED: Execution Error, return code 1 from
> > org.apache.hadoop.hive.ql.exec.DDLTask
> >
> > -----Original Message-----
> > From: Adriaan Tijsseling
> > Sent: Wednesday, October 19, 2011 3:01 PM
> > To: user@hive.apache.org
> > Subject: Re: When trying to create table Iam getting exception
> >
> > You should provide more information in order to get proper support
> > such as
> > the exact command you used to create the table.
> >
> > On 2011/10/19, at 11:16, kiranprasad wrote:
> >
> > > Hi
> > >
> > > Iam new to HIVE, when trying to create a table getting below
> > exception.> FAILED: Error in metadata:
> > java.lang.IllegalArgumentException: URI:  does
> > > not have a scheme
> > >
> > > Regards
> > > Kiran.G
> >
> >
> >
>

Reply via email to