GithubHelp home page GithubHelp logo

periscopedata / redshift-udfs Goto Github PK

View Code? Open in Web Editor NEW
125.0 18.0 31.0 22 KB

SQL for many helpful Redshift UDFs, and the scripts for generating and testing those UDFs

License: MIT License

Ruby 69.16% PLpgSQL 30.84%

redshift-udfs's Introduction

Redshift UDF Harness

AWS Redshift recently announced support Python-based User Defined Functions. This repository contains SQL for many helpful Redshift UDFs, and the scripts for generating and testing those UDFs.

If you'd like to contribute more UDFs, please send us a pull request or contact us over at Periscope.io

Usage

The scripts require Ruby. To connect to your cluster to add or test UDFs, you'll need the the pg gem and the following vars in your env or in the config.yaml:

  • UDF_CLUSTER_HOST -- host of your Redshift cluster, e.g. my-cluster.us-west-2.redshift.amazonaws.com
  • UDF_CLUSTER_PORT -- cluster's db port, e.g. 5439
  • UDF_CLUSTER_DB_NAME -- database name, e.g. master
  • UDF_CLUSTER_USER -- database user, e.g. read-write-user
  • UDF_CLUSTER_PASSWORD -- database user's password

Running the main file udf.rb without args shows how to use it:

Usage:
  ruby udf.rb <action> [udf_name]

Actions:
  load    Loads UDFs into your database
  drop    Removes UDFs from your database
  test    Runs UDF unit tests on your database
  print   Pretty-print SQL for making the UDFs

Examples:
  ruby udf.rb load
  ruby udf.rb drop harmonic_mean
  ruby udf.rb test json_array_first
  ruby udf.rb print

We look forward to bug reports, UDF requests, and general feedback :)

redshift-udfs's People

Contributors

antoineaugusti avatar compnski avatar davidthewatson avatar michael-erasmus avatar miike avatar mmmaia avatar mopatches avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redshift-udfs's Issues

Project status

Looks like last commit here was in 2016. Is this project still used an maintained by Periscope?

We use this project at Simple, although we don't have to interact with it much since we rarely define new UDFs.

We may start using UDFs more now that UDFs in SQL are available and perform better than the python versions. We may start looking more into that and I'd be interested to hear if others are relying on this project and would want to work together on adding support for SQL UDFs.

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.