SQL to HBase parser using Treetop (output based on Thrift).
Ruby Thrift
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
misc
spec
.document
.gitignore
.travis.yml
Gemfile
LICENSE
LICENSE.txt
README.md
README.rdoc
Rakefile
VERSION
hipster_sql_to_hbase.gemspec

README.md

hipster_sql_to_hbase logo

Hipster SQL To HBase Code Climate Code Climate

parsing sql to hbase (thrift) before it was cool

This project was born out of the need to migrate rapidly and efficiently a MySQL based application over to Hadoop's own HBase.

The HipsterSqlToHbase module provides the ability to produce Thrift compatible queries for HBase from SQL valid statements and execute them; and as if that wasn't cool enough I've also incorporated methods which give you access to each step of the transformation process, as in, the Treetop syntax tree, and the hashed parsing output relevant to each of the following query types:

  • CREATE type queries
  • SHOW type queries
  • INSERT type queries
  • SELECT type queries
  • UPDATE type queries
  • DROP/DELETE type queries

Getting Started

You can install it via RubyGems:

$ gem install hipster_sql_to_hbase

Usage

This is a no bullshit, straight as an arrow, to the point gem.

Simply require the gem and execute your SQL query. It's that simple:

require 'hipster_sql_to_hbase'

HipsterSqlToHbase.execute("INSERT INTO users (user,pass) VALUES ('andy','w00dy'),('zaphod','b33bl3br0x')",'www.my-hbase-server.com',9090)

And boom! You've got your result; which varies depending on the SQL query type you executed (i.e. SELECT, INSERT, etc).

Complexity

This gem provides a wide array of functionalities besides just parsing SQL to HBase (Thrift).

I'll eventually get around to listing some of the awesomeness withheld within these humble lines of code (especially as I play around with the gem and come up with some test cases), but in the meantime if you're curious about the added functionality of HipsterSqlToHbase, you'll surely want to checkout the RDoc I've generated and uploaded here.