Git Product home page Git Product logo

rs_to_sf's Introduction

RS to SF

Requires psycopg2, pyyaml, datetime, and snowflake-connector

pip3 install psycopg2 pyyaml datetime
pip3 install --upgrade snowflake-connector-python

Edit config file, rename to config.yml and run!

python3 rs_to_sf.py
  • Gets Table DDL from Redshift - many thanks to:

https://github.com/awslabs/amazon-redshift-utils/blob/master/src/AdminViews/v_generate_tbl_ddl.sql

  • Converts Redshift table ddl / data types to Snowflake
    • Does not include default values
    • Does not include serial/sequence creation
      • There are some comments in SQL file on how to do this.
      • You'll want to create sequences, then get table DDL that includes default values for those sequences.
      • I didn't run into any other scenarios/issues, but I"m sure they are out there...
  • CREATE table DDL in Snowflake DB (Make sure schema is created first)
  • UNLOAD table data from RS into S3 bucket
  • COPY cmd to load S3 files into SF table

To Do:

  • argparse for config file location
  • build in sequence generation
  • proper logging
  • multithreading/asyncio?

rs_to_sf's People

Contributors

jimmylowell avatar

Stargazers

 avatar

Watchers

 avatar  avatar

rs_to_sf's Issues

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.