Sunday, August 29, 2010

JDBC Connectivity to Hypertable!

Hypertable ( is an implementation of the Google's BigTable which in short is a scalable, distributed sorted hashtable allowing for the storage of massive amounts of data across a cluster of commodity hardware. Hypertable has a rich query language (HQL) and a command line client akin to MySql's command line client; however, this can be limiting.

This article will cover two things:
1) JDBC Connectivity to Hypertable
2) Usage of this driver to graphically browse and modify a Hypertable instance

JDBC Driver

Hypertable uses the Thrift protocol to remotely connect and query an instance. This is a very useful method of reading/writing data but it's not standard and can be difficult to develop applications using Hypertable. For Ruby developers, there is a package called HyperRecord which provides an ActiveRecord like interface to Hypertable which makes integrating Hypertable into a Ruby (on Rails) application much easier. For Java, I recently released a JDBC driver that communicates through Thrift to Hypertable which now allows you to integrate Hypertable into a Java application via JDBC. One such application is integration with a graphical browser which was the motivation behind writing this driver.

Driver Limitations:
  1. Only the latest timestamped version data is returned.
  2. When retrieving metadata objects (ResultSet or Database), only the column families defined in the schema will be returned. In other words, column family qualifiers aren't going to be shown in the metadata objects although their value can be retrieved in code. Example: In code, you can do rs.getString("address:home") and rs.getString("address:work") while the metadata will only show "address" as a valid column name with no value unless 'address' explicitly has a value in the given table.
You can download the driver at Simply add all the jars to your classpath and use the driver "org.hokiesuns.hypertable.jdbc.HTDriver". An example URL is "jdbc:hypertable://" with no username, password or schema. An example application can be found by executing org.hokiesuns.hypertable.HypertableJDBCTester passing in the ThriftBroker hostname/ip as the command line argument.

Graphical Browser

The motivation behind writing this driver was to be able to view data in Hypertable using a graphical browser instead of the command line. There are numerous java based graphical browsers and the one that I tested with was SQLWorkBench/J ( Rather than providing screenshots with explanations, I have created a video that should help show this driver in action and how easy it is to start talking to Hypertable using a third party graphical interface!


Along with integration for graphical browsing of Hypertable data, I believe that releasing a JDBC driver to Hypertable will help make its use more widespread and make it easier to plug this great technology into the vast Java application landscape. If you see any bugs, please file a bug report along with all the necessary information at


  1. Great! I'll check it out. I see you've worked with Solr- have you tried this with the DataImportHandler?

  2. Hi lance

    thanks for the comment. I have worked with the dih but haven't tried plugging this driver in yet. That sounds like a great idea though!

  3. Hi Amit,

    i am an engineer running a datawarehouse. One of the Databases we are sourcing from will change from mysql to hypertable. Do you think your JDBC driver is performant enough to use it in Kettle for ETL purposes?

  4. Hi primedape,

    I haven't done much with Kettle and unfortunately I also haven't done much performance testing of my JDBC driver; however, there isn't much complexity in there (if you look at the source it's only a handful of classes). I would be curious to see your results of any large job with this driver for it'd go a long way in it's adoption.


  5. org.apache.thrift.transport.TTransportException: Connection timed out: connect

    I did exactly same as in the above video. I'm getting exception, what to do?

    1. It looks like something is up with your hypertable connection. Are you sure that the thrift broker is running and that you can connect to it? If you continue to have difficulties, I'd suggest posting a question on the hypertable users mailing list. Thanks!

  6. Thanks for reply.

    Now I'm not getting that exception. Instead of another problem.


    DB connected.

    When i execute command like, create table anytable("name", "age")

    it is showing :

    An error occurred when executing the SQL command:
    create table user("name","age")

    Error executing create table user("name","age") because of Connection reset

    Execution time: 0.03s

    1 statement(s) failed.

    I think i did wrong in either port number/user/password/ip address. Can u plz help me to fix this error.

    1. Can you test that your HT installation is working by running the same HQL commands from the shell? i.e. ht shell?

    2. From ht shell i.e hypertable.exe, I can do all basic operations like create,delete ,select etc., Do you've sample code of java using hyper-table? In they written code for hypertable- which is deprecated. I want java sample code for hypertable- One more doubt is, should I install thrift compulsory? I think to run java code thriftlib.jar required then hypertable_(current version).jar required. Unfortunately i dint get after searching in google. I want you to help me.


  7. The link what you provided contains old hyper-table jars. Where do I get new versions of hyper-table jars? Please send the link or update..

    Thanks n advance.

    1. I don't have a copy of HT handy (as it's been a few years since I wrote this :-)) but if you have a copy installed, do a find for *.jar and you'll see the java bindings. It should be named similar to what is there now. Unfortunately I was going to migrate this to a Maven based project but didn't get the time to do so. I'm sure Doug would welcome the help!

  8. Thanks for reply.

    You know how to install and configure hyper-table in windows? I want clear explanation. I referred but i dint get. Can u plz tel me step by step?


    1. Unfortunately I don't know how to setup HT on Windows. I'd suggest emailing the users list (!forum/hypertable-user) to get some answers. Sorry!

  9. Hi,

    When I give className as "org.hokiesuns.hypertable.jdbc.HTDriver". It is showing the specified driver class(org.hokiesuns.hypertable.jdbc.HTDriver) is not available. What to do?


    1. Thanks for posting your question. Can you provide some more context? What's your classpath like? Are you in Eclipse or outside of it? More information the better. Thanks!

  10. Hi!

    I got ClientExeption(code:589827,message: Incalid namespace id:0) What can I do?


    1. What's the URI that you are using to access the table? Also what version of Hypertable are you using this with (I haven't tested this in a while in case something changed with respect to the API).

  11. Hi

    I think it is connected to DB because I can see "ready, if you are" in left bottom corner.
    I've downloaded from latgest version I think

  12. Try jdbc:hypertable:// ? or jdbc:hypertable:// to force the use of the '/' namespace.

  13. Hi!
    I've got same result. :(

    I can see all service are runnint: