-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #297 from matthias-Q/unload_statement
feat: add athena `unload` statement
- Loading branch information
Showing
3 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
================================================================================ | ||
Simple Unload | ||
================================================================================ | ||
|
||
UNLOAD (SELECT * FROM old_table) | ||
TO 's3://amzn-s3-demo-bucket/unload_test_1/' | ||
WITH (format = 'JSON') | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(program | ||
(statement | ||
(keyword_unload) | ||
(select | ||
(keyword_select) | ||
(select_expression | ||
(term | ||
(all_fields)))) | ||
(from | ||
(keyword_from) | ||
(relation | ||
(object_reference | ||
(identifier)))) | ||
(keyword_to) | ||
(storage_parameters | ||
(keyword_with) | ||
(identifier) | ||
(literal)))) | ||
|
||
================================================================================ | ||
Unload with ARRAY | ||
================================================================================ | ||
|
||
UNLOAD (SELECT name1, address1, comment1, key1 FROM table1) | ||
TO 's3://amzn-s3-demo-bucket/ partitioned/' | ||
WITH (format = 'TEXTFILE', partitioned_by = ARRAY['key1']) | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(program | ||
(statement | ||
(keyword_unload) | ||
(select | ||
(keyword_select) | ||
(select_expression | ||
(term | ||
(field | ||
(identifier))) | ||
(term | ||
(field | ||
(identifier))) | ||
(term | ||
(field | ||
(identifier))) | ||
(term | ||
(field | ||
(identifier))))) | ||
(from | ||
(keyword_from) | ||
(relation | ||
(object_reference | ||
(identifier)))) | ||
(keyword_to) | ||
(storage_parameters | ||
(keyword_with) | ||
(identifier) | ||
(literal) | ||
(identifier) | ||
(array | ||
(keyword_array) | ||
(literal))))) |