@@ -21,33 +21,33 @@ create table source_table(col1 integer, col2 varchar) as values (1, 'Foo'), (2,
21
21
22
22
# Copy to directory as multiple files
23
23
query IT
24
- COPY source_table TO 'test_files/scratch/table' (format parquet, per_thread_output true);
24
+ COPY source_table TO 'test_files/scratch/copy/ table' (format parquet, per_thread_output true);
25
25
----
26
26
2
27
27
28
28
# Error case
29
29
query error DataFusion error: Error during planning: Copy To format not explicitly set and unable to get file extension!
30
- EXPLAIN COPY source_table to 'test_files/scratch/table'
30
+ EXPLAIN COPY source_table to 'test_files/scratch/copy/ table'
31
31
32
32
query TT
33
- EXPLAIN COPY source_table to 'test_files/scratch/table' (format parquet, per_thread_output true)
33
+ EXPLAIN COPY source_table to 'test_files/scratch/copy/ table' (format parquet, per_thread_output true)
34
34
----
35
35
logical_plan
36
- CopyTo: format=parquet output_url=test_files/scratch/table per_thread_output=true options: (format parquet, per_thread_output true)
36
+ CopyTo: format=parquet output_url=test_files/scratch/copy/ table per_thread_output=true options: (format parquet, per_thread_output true)
37
37
--TableScan: source_table projection=[col1, col2]
38
38
physical_plan
39
39
InsertExec: sink=ParquetSink(writer_mode=PutMultipart, file_groups=[])
40
40
--MemoryExec: partitions=4, partition_sizes=[1, 0, 0, 0]
41
41
42
42
# Copy more files to directory via query
43
43
query IT
44
- COPY (select * from source_table UNION ALL select * from source_table) to 'test_files/scratch/table' (format parquet, per_thread_output true);
44
+ COPY (select * from source_table UNION ALL select * from source_table) to 'test_files/scratch/copy/ table' (format parquet, per_thread_output true);
45
45
----
46
46
4
47
47
48
48
# validate multiple parquet file output
49
49
statement ok
50
- CREATE EXTERNAL TABLE validate_parquet STORED AS PARQUET LOCATION 'test_files/scratch/table/';
50
+ CREATE EXTERNAL TABLE validate_parquet STORED AS PARQUET LOCATION 'test_files/scratch/copy/ table/';
51
51
52
52
query IT
53
53
select * from validate_parquet;
@@ -61,13 +61,13 @@ select * from validate_parquet;
61
61
62
62
# Copy from table to single file
63
63
query IT
64
- COPY source_table to 'test_files/scratch/table.parquet';
64
+ COPY source_table to 'test_files/scratch/copy/ table.parquet';
65
65
----
66
66
2
67
67
68
68
# validate single parquet file output
69
69
statement ok
70
- CREATE EXTERNAL TABLE validate_parquet_single STORED AS PARQUET LOCATION 'test_files/scratch/table.parquet';
70
+ CREATE EXTERNAL TABLE validate_parquet_single STORED AS PARQUET LOCATION 'test_files/scratch/copy/ table.parquet';
71
71
72
72
query IT
73
73
select * from validate_parquet_single;
@@ -77,13 +77,13 @@ select * from validate_parquet_single;
77
77
78
78
# copy from table to folder of csv files
79
79
query IT
80
- COPY source_table to 'test_files/scratch/table_csv' (format csv, per_thread_output true);
80
+ COPY source_table to 'test_files/scratch/copy/ table_csv' (format csv, per_thread_output true);
81
81
----
82
82
2
83
83
84
84
# validate folder of csv files
85
85
statement ok
86
- CREATE EXTERNAL TABLE validate_csv STORED AS csv WITH HEADER ROW LOCATION 'test_files/scratch/table_csv';
86
+ CREATE EXTERNAL TABLE validate_csv STORED AS csv WITH HEADER ROW LOCATION 'test_files/scratch/copy/ table_csv';
87
87
88
88
query IT
89
89
select * from validate_csv;
@@ -93,13 +93,13 @@ select * from validate_csv;
93
93
94
94
# Copy from table to single csv
95
95
query IT
96
- COPY source_table to 'test_files/scratch/table.csv';
96
+ COPY source_table to 'test_files/scratch/copy/ table.csv';
97
97
----
98
98
2
99
99
100
100
# Validate single csv output
101
101
statement ok
102
- CREATE EXTERNAL TABLE validate_single_csv STORED AS csv WITH HEADER ROW LOCATION 'test_files/scratch/table.csv';
102
+ CREATE EXTERNAL TABLE validate_single_csv STORED AS csv WITH HEADER ROW LOCATION 'test_files/scratch/copy/ table.csv';
103
103
104
104
query IT
105
105
select * from validate_single_csv;
@@ -109,13 +109,13 @@ select * from validate_single_csv;
109
109
110
110
# Copy from table to folder of json
111
111
query IT
112
- COPY source_table to 'test_files/scratch/table_json' (format json, per_thread_output true);
112
+ COPY source_table to 'test_files/scratch/copy/ table_json' (format json, per_thread_output true);
113
113
----
114
114
2
115
115
116
116
# Validate json output
117
117
statement ok
118
- CREATE EXTERNAL TABLE validate_json STORED AS json LOCATION 'test_files/scratch/table_json';
118
+ CREATE EXTERNAL TABLE validate_json STORED AS json LOCATION 'test_files/scratch/copy/ table_json';
119
119
120
120
query IT
121
121
select * from validate_json;
@@ -125,13 +125,13 @@ select * from validate_json;
125
125
126
126
# Copy from table to single json file
127
127
query IT
128
- COPY source_table to 'test_files/scratch/table.json';
128
+ COPY source_table to 'test_files/scratch/copy/ table.json';
129
129
----
130
130
2
131
131
132
132
# Validate single JSON file`
133
133
statement ok
134
- CREATE EXTERNAL TABLE validate_single_json STORED AS json LOCATION 'test_files/scratch/table_json';
134
+ CREATE EXTERNAL TABLE validate_single_json STORED AS json LOCATION 'test_files/scratch/copy/ table_json';
135
135
136
136
query IT
137
137
select * from validate_single_json;
@@ -141,13 +141,13 @@ select * from validate_single_json;
141
141
142
142
# Copy from table with options
143
143
query IT
144
- COPY source_table to 'test_files/scratch/table.json' (row_group_size 55);
144
+ COPY source_table to 'test_files/scratch/copy/ table.json' (row_group_size 55);
145
145
----
146
146
2
147
147
148
148
# Copy from table with options (and trailing comma)
149
149
query IT
150
- COPY source_table to 'test_files/scratch/table.json' (row_group_size 55, row_group_limit_bytes 9,);
150
+ COPY source_table to 'test_files/scratch/copy/ table.json' (row_group_size 55, row_group_limit_bytes 9,);
151
151
----
152
152
2
153
153
0 commit comments