hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edward Capriolo <edlinuxg...@gmail.com>
Subject Re: Documentation for using JDBC interface?
Date Fri, 27 Mar 2009 18:43:58 GMT
On Fri, Mar 27, 2009 at 2:05 PM, Jeff Hammerbacher <hammer@cloudera.com> wrote:
> Thanks Raghu; wikified at
> http://wiki.apache.org/hadoop/Hive/HiveJDBCInterface.
>
> On Fri, Mar 27, 2009 at 7:41 AM, Raghu Murthy <raghu@facebook.com> wrote:
>>
>> Right now JDBC support provided by Hive is minimal. You can just run
>> queries
>> and fetch results. None of the metadata calls work. Sample usage is in
>> jdbc/src/test.
>>
>>
>> On 3/26/09 3:26 PM, "Jeff Hammerbacher" <hammer@cloudera.com> wrote:
>>
>> > Hey,
>> >
>> > We've been working through JDBC support in Hive and I couldn't help but
>> > notice
>> > that there's no mention of the JDBC driver on the wiki or the main site.
>> > It
>> > would be really helpful if someone familiar with that part of the
>> > codebase
>> > would write up some information on how to use it.
>> >
>> > Thanks,
>> > Jeff
>>
>
>


Let me drop in a couple notes.

http://wiki.apache.org/hadoop/Hive/HiveWebInterface

Someone reported something similar to the missing war file.
${HIVE_HOME}/lib/hive_hwi.war
The WAR File is created in the 'ant deploy' step. Maybe it should be
moved to the 'ant package' step. How did you build and install?

I think the preferred way to interact with Hive is the thrift server.
Someone might slap me for saying this, but you can use the Web
Interface Session Manager for this as well.  I realized this as I was
writing some Web UI test cases that this is a pretty neat way to run
hive queries....

Check out this code block.
****************
 hsm = new HWISessionManager(){ };
 Thread t = new Thread(hsm);
 t.start();

 HWISessionItem item = hsm.createSession(this.hiveAuth, "create");
 String query = "SHOW TABLES" ;

       item.setQuery(query );
       try {
        item.clientStart();
       } catch (HWIException ex){ System.err.println(ex.toString());}
       while (item.getStatus()!=
HWISessionItem.WebSessionItemStatus.QUERY_COMPLETE){
         try {
          Thread.sleep(5000);
         } catch (InterruptedException ex){}
       }
       if (item.getQueryRet()!=0){
          System.err.println("query returned" + item.getQueryRet());
       }
       try {
        item.clientRenew();
       } catch (HWIException ex){
         System.err.println("problem with renew"+ ex);
       }
   ********

If you need any help with the Web UI let me know.

Mime
View raw message