Files
greptimedb/tests/cases/standalone/common/copy/copy_from_fs_csv.result
2023-09-28 06:21:18 +00:00

80 lines
2.1 KiB
Plaintext

CREATE TABLE demo(host string, cpu double, memory double, ts TIMESTAMP time index);
Affected Rows: 0
insert into demo(host, cpu, memory, ts) values ('host1', 66.6, 1024, 1655276557000), ('host2', 88.8, 333.3, 1655276558000);
Affected Rows: 2
Copy demo TO '/tmp/demo/export/csv/demo.csv' with (format='csv');
Affected Rows: 2
CREATE TABLE with_filename(host string, cpu double, memory double, ts timestamp time index);
Affected Rows: 0
Copy with_filename FROM '/tmp/demo/export/csv/demo.csv' with (format='csv');
Affected Rows: 2
select * from with_filename order by ts;
+-------+------+--------+---------------------+
| host | cpu | memory | ts |
+-------+------+--------+---------------------+
| host1 | 66.6 | 1024.0 | 2022-06-15T07:02:37 |
| host2 | 88.8 | 333.3 | 2022-06-15T07:02:38 |
+-------+------+--------+---------------------+
CREATE TABLE with_path(host string, cpu double, memory double, ts timestamp time index);
Affected Rows: 0
Copy with_path FROM '/tmp/demo/export/csv/' with (format='csv');
Affected Rows: 2
select * from with_path order by ts;
+-------+------+--------+---------------------+
| host | cpu | memory | ts |
+-------+------+--------+---------------------+
| host1 | 66.6 | 1024.0 | 2022-06-15T07:02:37 |
| host2 | 88.8 | 333.3 | 2022-06-15T07:02:38 |
+-------+------+--------+---------------------+
CREATE TABLE with_pattern(host string, cpu double, memory double, ts timestamp time index);
Affected Rows: 0
Copy with_pattern FROM '/tmp/demo/export/csv/' WITH (pattern = 'demo.*',format='csv');
Affected Rows: 2
select * from with_pattern order by ts;
+-------+------+--------+---------------------+
| host | cpu | memory | ts |
+-------+------+--------+---------------------+
| host1 | 66.6 | 1024.0 | 2022-06-15T07:02:37 |
| host2 | 88.8 | 333.3 | 2022-06-15T07:02:38 |
+-------+------+--------+---------------------+
drop table demo;
Affected Rows: 0
drop table with_filename;
Affected Rows: 0
drop table with_path;
Affected Rows: 0
drop table with_pattern;
Affected Rows: 0