Skip to content

ankane/drill-ruby

Repository files navigation

Drill Ruby

Ruby client for Apache Drill

Build Status

Installation

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"

Getting Started

Create a client

drill = Drill::Client.new(url: "http://localhost:8047")

And query away

drill.query("SELECT * FROM dfs.`/path/to/some/file.csvh`")

Endpoints

API docs

Query

Run a query

drill.query(
  query,
  limit: nil,
  default_schema: nil,
  username: nil
)

Profiles

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)

Storage

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)

Info

Get cluster info

drill.cluster

Get metrics

drill.metrics

Get options

drill.options

Reference

Set timeouts

Drill::Client.new(open_timeout: 5, read_timeout: 120)

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/drill-ruby.git
cd drill-ruby
bundle install
bundle exec rake test

About

Ruby client for Apache Drill

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages