FAQ
Hi all,

I have created the database test_db in hive using command 'create database
test_db'. Then i have created the table test_db_tb inside the database
test_db.

Now , I want to access those table using hive jdbc driver.

I have used the following connection string 'jdbc:hive://
192.168.41.52:10000/test_db' but it was using the hive default database
instead of test_db. How i can specify the hive database name??

Thanks,
Ankit Jain

Search Discussions

  • Rakesh rakshit at Oct 17, 2011 at 10:36 am
    Hi Ankit,

    I am able to find that its support has been included in the latest 0.7.1
    Hive API.

    Please go through the HiveMetaStoreClient.getDatabase(String dbName) and
    HiveMetaStoreClient.getAllTables(String dbName) methods in the new api.

    Hope this may help you.

    Thanks,

    Rakesh Kumar Rakshit
    Impetus Infotech(India) Pvt. Ltd.
    ww.impetus.com
    On Mon, Oct 17, 2011 at 1:06 PM, Ankit Jain wrote:

    Hi all,

    I have created the database test_db in hive using command 'create database
    test_db'. Then i have created the table test_db_tb inside the database
    test_db.

    Now , I want to access those table using hive jdbc driver.

    I have used the following connection string 'jdbc:hive://
    192.168.41.52:10000/test_db' but it was using the hive default database
    instead of test_db. How i can specify the hive database name??

    Thanks,
    Ankit Jain
  • Ankit Jain at Oct 19, 2011 at 11:56 am
    Hi Rakesh,

    Thanks for reply, I have tried hive-0.7.1 api but following error is
    occurred.

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

    Below the 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();




    On Mon, Oct 17, 2011 at 4:05 PM, rakesh rakshit wrote:

    Hi Ankit,

    I am able to find that its support has been included in the latest 0.7.1
    Hive API.

    Please go through the HiveMetaStoreClient.getDatabase(String dbName) and
    HiveMetaStoreClient.getAllTables(String dbName) methods in the new api.

    Hope this may help you.

    Thanks,

    Rakesh Kumar Rakshit
    Impetus Infotech(India) Pvt. Ltd.
    ww.impetus.com

    On Mon, Oct 17, 2011 at 1:06 PM, Ankit Jain wrote:

    Hi all,

    I have created the database test_db in hive using command 'create database
    test_db'. Then i have created the table test_db_tb inside the database
    test_db.

    Now , I want to access those table using hive jdbc driver.

    I have used the following connection string 'jdbc:hive://
    192.168.41.52:10000/test_db' but it was using the hive default database
    instead of test_db. How i can specify the hive database name??

    Thanks,
    Ankit Jain

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedOct 17, '11 at 7:36a
activeOct 19, '11 at 11:56a
posts3
users2
websitehive.apache.org

2 users in discussion

Ankit Jain: 2 posts Rakesh rakshit: 1 post

People

Translate

site design / logo © 2022 Grokbase