Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Phoenix Guest Blog for Apache

James Taylor edited this page Oct 25, 2013 · 6 revisions

logo

I'm thrilled to be guest blogging today about Phoenix, an open source SQL skin for HBase that powers the HBase use cases at Salesforce.com. As opposed to relying on map-reduce to execute SQL queries as other similar projects, Phoenix compiles your SQL query into a series of HBase scans, and orchestrates the running of those scans to produce regular JDBC result sets. On top of that, you can add secondary indexes to your tables to transform what would normally be a full table scan into a series of point gets (and we all know how good HBase performs with those).

Getting Started

To get started using phoenix, follow these directions:

  • Download and expand the latest phoenix-2.1.0-install.tar from download page
  • Add the phoenix-2.1.0.jar to the classpath of every HBase region server. An easy way to do this is to copy it into the HBase lib directory.
  • Restart all region servers
  • Start our terminal interface that is bundled with our distribution against your cluster:
        $ bin/sqlline.sh localhost
  • Create a Phoenix table:
        create table stock_price(ticker varchar(6), price decimal, date date);
        select * from stock_price;
        select * from stock_price where ticker='CRM';
        select ticker, avg(price) from stock_price 
            where date between current_date()-30 and current_date() 
            group by ticker;

Questions/Comments?

Take a look at our recent announcement for our release which includes support for secondary indexing, peruse our FAQs and join our mailing list.

Clone this wiki locally