Impaler
Impaler combines the best of Impala and Hive. Queries are run on Impala and if it fails there it will fallback to running the query in Hive.
Installation
Add this line to your application's Gemfile:
gem 'impaler'
And then execute:
$ bundle
Or install it yourself as:
$ gem install impaler
Usage
Basic Usage
require 'impaler'
c = Impaler.connect(['impala_server:21000'], ['hivethrift_server:10000'])
c.query("select count(*) from my_table") # This will run in Impala
c.query("select name, collect_set(foo) from my_table") # This will run in Hive (after a quick error on Impala)
c.query("select count(*) from my_table", Impaler::HIVE_ONLY) # This is forced to run on Hive
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Test your changes in both connected and unconnected modes (
rspec
andIMPALA_SERVER=server:21000 HIVETHRIFT_SERVER=server:10000 TEST_TABLE=my_test_table TEST_TABLE_COLUMN=some_test_column rspec
- Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request