Giter VIP home page Giter VIP logo

td-tech's Introduction

README

query.py

This script provides a command line wrapper to execute a query on a Treasure Data database table and downloads the results.

Database Info:

Database Name: airport_data Table Name: sfo_pass_raw

This database table contains passenger data that have deplaned/enplaned at SFO International Airport.

Prerequisites:

TD toolbelt Python 2.7 or newer Python bindings - td-client

To Run:

python query.py <db_name> <table_name>

Eg: python query.py airport_data sfo_pass_raw

The database and table names are mandatory arguments that need to be passed.

Optional Parameters:

-f : can be used to specify results download format - csv or tabular (default) -e : can be used to specify engine - hive or presto (default) -c : can be used to specify a column list, by default all columns will be returned -m : a minimum timestamp can be specified -M : a maximum timestamp can be specified -l : a limit on the number of rows returned can be specified. By default, it will return all rows

Eg: python query.py -f csv -e hive -c year,month,time -m 1420099200 -M 1433142000 -l 5 airport_data sfo_pass_raw

Queries Executed:

See Query.txt

For results of each query, see Results_#.txt (e.g.: Results_1.txt contains results of Query 1)

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.