@@ -241,14 +241,15 @@ def __init__(self, schema_name, table_name, data_location, access_key, secret_ke
241
241
self: An instance of CopyCommand
242
242
schema_name - Schema associated with the table_name
243
243
table_name: The table to copy the data into
244
- data_location The Amazon S3 location from where to copy
244
+ data_location The Amazon S3 location from where to copy - or a manifest file if 'manifest' option is used
245
245
access_key - AWS Access Key (required)
246
246
secret_key - AWS Secret Key (required)
247
247
session_token - AWS STS Session Token (optional)
248
248
options - Set of optional parameters to modify the COPY sql
249
249
delimiter - File delimiter; defaults to ','
250
250
ignore_header - Integer value of number of lines to skip at the start of each file
251
251
null - Optional string value denoting what to interpret as a NULL value from the file
252
+ manifest - Boolean value denoting whether data_location is a manifest file; defaults to False
252
253
empty_as_null - Boolean value denoting whether to load VARCHAR fields with
253
254
empty values as NULL instead of empty string; defaults to True
254
255
blanks_as_null - Boolean value denoting whether to load VARCHAR fields with
@@ -275,6 +276,7 @@ def visit_copy_command(element, compiler, **kw):
275
276
DELIMITER '%(delimiter)s'
276
277
IGNOREHEADER %(ignore_header)s
277
278
%(null)s
279
+ %(manifest)s
278
280
%(empty_as_null)s
279
281
%(blanks_as_null)s;
280
282
""" % \
@@ -287,6 +289,7 @@ def visit_copy_command(element, compiler, **kw):
287
289
'null' : ("NULL '%s'" % element .options .get ('null' )) if element .options .get ('null' ) else '' ,
288
290
'delimiter' : element .options .get ('delimiter' , ',' ),
289
291
'ignore_header' : element .options .get ('ignore_header' , 0 ),
292
+ 'manifest' : 'MANIFEST' if bool (element .options .get ('manifest' , False )) else '' ,
290
293
'empty_as_null' : 'EMPTYASNULL' if bool (element .options .get ('empty_as_null' , True )) else '' ,
291
294
'blanks_as_null' : 'BLANKSASNULL' if bool (element .options .get ('blanks_as_null' , True )) else '' }
292
295
0 commit comments