Skip to main content

pyDrill-dsl

https://img.shields.io/travis/PythonicNinja/pydrill_dsl.svg https://img.shields.io/pypi/v/pydrill_dsl.svg Documentation Status https://coveralls.io/repos/github/PythonicNinja/pydrill_dsl/badge.svg

Pythonic DSL for Apache Drill.

Schema-free SQL Query Engine for Hadoop, NoSQL and Cloud Storage

Features

  • Uses Peewee syntax

  • Support for all storage plugins

  • Support for drivers PyODBC and pyDrill

Sample usage

from pydrill_dsl.resource import Resource

class Employee(Resource):
    first_name = Field()
    salary = Field()
    position_id = Field()
    department_id = Field()

    class Meta:
        storage_plugin = 'cp'
        path = 'employee.json'


Employee.select().filter(salary__gte=17000)

Employee.select().paginate(page=1, paginate_by=5)


salary_gte_17K = (Employee.salary >= 17000)
salary_lte_25K = (Employee.salary <= 25000)
Employee.select().where(salary_gte_17K & salary_lte_25K)

Employee.select(
    fn.Min(Employee.salary).alias('salary_min'),
    fn.Max(Employee.salary).alias('salary_max')
).scalar(as_tuple=True)

# creation of resource can be done without creation of class:
employee = Resource(storage_plugin='cp', path='employee.json',
                    fields=('first_name', 'salary', 'position_id', 'department_id'))

History

0.0.2 (2016-05-19)

  • First release on PyPI.

  • Uses Peewee syntax

  • Support for all storage plugins

  • Support for drivers PyODBC and pyDrill

  • Builds are tested by docker container with Apache Drill running

0.0.1 (2016-02-18)

  • Initial release on github.

Metadata

Release history Release notifications | RSS feed

This release

0.0.2 This release

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page