Created
December 20, 2016 18:03
-
-
Save Melraidin/016062e44b8d36926a2a625cbf06cc54 to your computer and use it in GitHub Desktop.
Base class to load Athena data to Redshift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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