-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathunload.txt
71 lines (64 loc) · 1.7 KB
/
unload.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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)))))