Coder Social home page Coder Social logo

kmdpartners / redshift-udfs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from periscopedata/redshift-udfs

0.0 10.0 0.0 25 KB

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

License: MIT License

Ruby 69.77% PLpgSQL 30.23%

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 :)

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.