Skip to content

Instantly share code, notes, and snippets.

View sjanahan's full-sized avatar

Janahan Sivaraman sjanahan

View GitHub Profile
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)
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')
@sjanahan
sjanahan / jwenv.sh
Last active October 27, 2017 19:56 — forked from donato/jwenv.sh
Set JW Environment variables
# !/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
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')