You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/cases/standalone/common/copy/copy_from_fs_csv.result
+35-81Lines changed: 35 additions & 81 deletions
Original file line number
Diff line number
Diff line change
@@ -17,61 +17,40 @@ values
17
17
18
18
Affected Rows: 1
19
19
20
-
CREATE TABLE demo_2(host string, ts TIMESTAMP time index);
21
-
22
-
Affected Rows: 0
23
-
24
-
insert into
25
-
demo_2(host, ts)
26
-
values
27
-
('host4', 1755276557000),
28
-
('host5', 1755276558000),
29
-
('host6', 1822077263000);
30
-
31
-
Affected Rows: 3
32
-
33
-
Copy demo_2 TO '${SQLNESS_HOME}/demo/export/csv/demo_2.csv' with (format='csv');
34
-
35
-
Affected Rows: 3
36
-
37
20
Copy demo TO '${SQLNESS_HOME}/demo/export/csv/demo.csv' with (format='csv');
38
21
39
22
Affected Rows: 3
40
23
41
-
CREATE TABLE check_header(host string, ts timestamp time index);
24
+
CREATE TABLE with_filename(host string, cpu double, memory double, ts timestamp time index);
42
25
43
26
Affected Rows: 0
44
27
45
-
Copy check_header FROM '${SQLNESS_HOME}/demo/export/csv/' with (pattern = 'demo*', format='csv', header='true', continue_on_error='true');
28
+
Copy with_filename FROM '${SQLNESS_HOME}/demo/export/csv/demo.csv' with (format='csv', start_time='2022-06-15 07:02:37', end_time='2022-06-15 07:02:39');
46
29
47
-
Affected Rows: 3
30
+
Affected Rows: 0
48
31
49
-
select * from check_header order by ts;
32
+
select * from with_filename order by ts;
50
33
51
-
+-------+---------------------+
52
-
| host | ts |
53
-
+-------+---------------------+
54
-
| host4 | 2025-08-15T16:49:17 |
55
-
| host5 | 2025-08-15T16:49:18 |
56
-
| host6 | 2027-09-27T20:34:23 |
57
-
+-------+---------------------+
34
+
++
35
+
++
58
36
59
-
CREATE TABLE with_filename(host string, cpu double, memory double, ts timestamp time index);
37
+
CREATE TABLE with_json(host string, cpu double, memory double, jsons JSON, ts timestamp time index);
60
38
61
39
Affected Rows: 0
62
40
63
-
Copy with_filename FROM '${SQLNESS_HOME}/demo/export/csv/demo.csv' with (format='csv', header='false', start_time='2022-06-15 07:02:37', end_time='2022-06-15 07:02:39');
41
+
Copy with_json FROM '${SQLNESS_HOME}/demo/export/json/demo.json' with (format='json');
64
42
65
-
Affected Rows: 2
43
+
Affected Rows: 3
66
44
67
-
select * from with_filename order by ts;
45
+
select host, cpu, memory, json_to_string(jsons), ts from with_json order by ts;
0 commit comments