Giter Site home page Giter Site logo

gimlet's Introduction

Gimlet - JavaScript Client for Apache Drill

Gimlet is an open source Node.js module for Apache Drill - and the first that supports authentication. It's build using modern JavaScript and supports promises and async/await.

Installation

You can either use npm...

$ npm i @padho/gimlet

... or yarn

$ yarn add @padho/gimlet

Usage

Using Gimlet is simple. Let's take a look at the following basic example:

// Import Gimlet
const {Gimlet} = require('@padho/gimlet');
let data;

// Create a new Gimlet instance
let options = {
    host: '127.0.0.1', // Host
    port: 8047, // Port
    user: null, // Drill user
    password: null, // Drill user password
    ssl: false, // Use SSL
    restTimeout: 15000 // Timeout for running queries
};

let gimlet = new Gimlet(options);

try {
    data = await gimlet.query(
        'select * from dfs.`/Users/Patrick/Data/myCoolDataSet.csv` limit 3'
    );
} catch(e) {
    // Some error occured!
}

API

Gimlet currently provides support for following REST APIs of Apache Drill:

// ...
// Sends a query to Drill (default queryType is SQL)
gimlet.query(query, queryType);

// Lists all installed storage plugins
gimlet.getStorageList();

// Gets the config of a specific storage plugin by name
gimlet.getStoragePluginByName(name);

// Enables a specific storage plugin by name
gimlet.enableStoragePluginByName(name);

// Disables a specific storage plugin by name
gimlet.disableStoragePluginByName(name);

//Creates a new storage plugin by name and definition
gimlet.createStoragePluginByName(definition);

// Deletes a specific storage plugin by name
gimlet.deleteStoragePluginByName(name);

// Deletes a specific storage plugin by name
gimlet.deleteStoragePluginByName(name);

 // Checks if a specific storage plugin exists
gimlet.storagePluginExists(name);

License

Apache-2.0 © Patrick Holl

gimlet's People

Contributors

padho avatar

Stargazers

rong fengliang avatar  avatar

Watchers

James Cloos avatar  avatar Branislav Vidojevic avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.