Skip to content

Instantly share code, notes, and snippets.

Janahan Sivaraman sjanahan

Block or report user

Report or block sjanahan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sjanahan
sjanahan / jwenv.sh
Last active Oct 27, 2017 — forked from donato/jwenv.sh
Set JW Environment variables
View jwenv.sh
# !/bin/bash
# This has two assumptions
# 1. Virtual environment set up in ~/venv/{project-name}
# 2. Configuration for configuration set up in ~/salt/{project-name}
# Given the name of the project as parameter
# $jwenv mini-batch
function project_name {
if [ -z $1 ];
then
View load_from_s3_to_redshift.py
from __future__ import print_function
import boto3
import urllib
import os
import psycopg2
print('Loading function')
s3_client = boto3.client('s3')
s3_object = boto3.resource('s3')
View gist:e8b5250e508333ca3d73930909eacb46
from __future__ import print_function
import boto3
import urllib
import os
import psycopg2
print('Loading function')
s3_client = boto3.client('s3')
s3_object = boto3.resource('s3')
View gist:74dfe1e3f191855bd115fed4cbc8cd69
def upload(csv: File): Unit = {
val conn = dBUtil.getJDBC
val tableName = "weather"
// Export table as CSV using the /copy command
val copyManager = new CopyManager(conn.asInstanceOf[BaseConnection])
val currentDirectory = new java.io.File(".").getCanonicalPath
println(currentDirectory)
You can’t perform that action at this time.