Using Toad to pick the winner for our Hadoop Summit contest

July 13th, 2011 by Guy Harrison

The energy at this years Hadoop summit was amazing, and it was great to get a chance to share experiences with so many smart people.

I was asked to pick the winner from of our Hadoop  World gift voucher,  and obviously I didn’t want to use any low-tech methods.  So I thought I’d use Toad for Cloud databases and Hbase.

Marketing gave me the entry data in a spread sheet format.  I then used the Toad for Cloud Databases ODBC connectivity to map that spreadsheet as a table.  This requires that we name a range in Excel, but it is pretty quick:

Mapping spreadsheet in TCD

Once the spreadsheet is mapped to a table, we can easily copy it into a hbase table:

 

Now that it is in hbase I suppose I could write a Java program  to pick a random row, but it’s much easier for me to use SQL.  All I need to do is sort by the RAND() function and LIMIT the result to 1, as in the snippet below:

 

 

And the winner is Wai So from Ebay!  Congrats!

 

 

Leave a Reply