Ruby client for Apache Drill
First, install Apache Drill. For Homebrew, use:
brew install apache-drill
drill-embedded
And add this line to your application’s Gemfile:
gem "drill-sergeant"
Create a client
drill = Drill::Client.new(url: "http://localhost:8047")
And query away
drill.query("SELECT * FROM dfs.`/path/to/some/file.csvh`")
Run a query
drill.query(
query,
limit: nil,
default_schema: nil,
username: nil
)
Get profiles of running and completed queries
drill.profiles
Get the profile of a query
drill.profiles(query_id)
Cancel a query
drill.cancel_query(query_id)
List storage plugins
drill.storage
Get a storage plugin by name
drill.storage(name)
Enable a storage plugin
drill.enable_storage(name)
Disable a storage plugin
drill.disable_storage(name)
Create or update a storage plugin
drill.update_storage(
name,
type: nil,
enabled: nil,
connection: nil,
workspaces: nil,
formats: nil
)
Delete a storage plugin
drill.delete_storage(name)
Get cluster info
drill.cluster
Get metrics
drill.metrics
Get options
drill.options
Set timeouts
Drill::Client.new(open_timeout: 5, read_timeout: 120)
View the changelog
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/drill-ruby.git
cd drill-ruby
bundle install
bundle exec rake test