mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 21:32:58 +00:00
* wip: use * rebase develop * chore: fix typos * feat: replace export parquet writer with buffered writer * fix: some cr comments * feat: add sst_write_buffer_size config item to config how many bytes to buffer before flush to underlying storage * chore: reabse onto develop
80 lines
2.0 KiB
Plaintext
80 lines
2.0 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/demo.parquet';
|
|
|
|
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/demo.parquet';
|
|
|
|
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/';
|
|
|
|
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/' WITH (PATTERN = 'demo.*');
|
|
|
|
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: 1
|
|
|
|
drop table with_filename;
|
|
|
|
Affected Rows: 1
|
|
|
|
drop table with_path;
|
|
|
|
Affected Rows: 1
|
|
|
|
drop table with_pattern;
|
|
|
|
Affected Rows: 1
|
|
|