Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/colinmarc/impala-ruby

an impala client for ruby
https://github.com/colinmarc/impala-ruby

Last synced: 24 days ago
JSON representation

an impala client for ruby

Awesome Lists containing this project

README

        

# impala-ruby

[![build](https://travis-ci.org/colinmarc/impala-ruby.svg?branch=master)](https://travis-ci.org/colinmarc/impala-ruby)   [![rubygems](https://badge.fury.io/rb/impala.svg)](http://rubygems.org/gems/impala)

This is a ruby client for [Cloudera Impala][1]. You use it like this:

```ruby
require 'impala'

Impala.connect('host', 21000) do |conn|
conn.query('SELECT zip, income FROM zipcode_incomes LIMIT 5')
end
# => [{:zip=>'02446', :income=>89597}, ...]
```

You can also use cursors to avoid loading the entire result set into memory:

```ruby
conn = Impala.connect('host', 21000)
cursor = conn.execute('SELECT zip, income FROM zipcode_incomes ORDER BY income DESC')

one_row = cursor.fetch_row
cursor.each do |row|
# etc
end

conn.close
```

[1]: https://ccp.cloudera.com/display/IMPALA10BETADOC/Introducing+Cloudera+Impala