Skip to content

Instantly share code, notes, and snippets.

@Melraidin
Created December 20, 2016 18:03
Show Gist options
  • Save Melraidin/016062e44b8d36926a2a625cbf06cc54 to your computer and use it in GitHub Desktop.
Save Melraidin/016062e44b8d36926a2a625cbf06cc54 to your computer and use it in GitHub Desktop.
Base class to load Athena data to Redshift
import datetime
import jaydebeapi;
import luigi
import luigi.s3
import sources
class AthenaLoad(sources.RedshiftLoad):
"""
Load Athena output to Redshift.
Requires implementing a requires() method whose output will be
used as the source for the Redshift load.
"""
def __init__(self, *args, **kwargs):
super(AthenaLoad, self).__init__(*args, **kwargs)
self.filename = self.requires().output().path
def s3_load_path(self):
return self.filename
@property
def do_truncate_table(self):
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment