Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
133 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
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_1_2'; | ||
|
||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
CREATE TABLE demo(host string, cpu double, memory double, ts TIMESTAMP time index); | ||
|
||
insert into demo(host, cpu, memory, ts) values ('host1', 66.6, 1024, 1655276557000), ('host2', 88.8, 333.3, 1655276558000); | ||
|
||
Copy demo TO '/tmp/demo/export/demo.parquet'; | ||
|
||
CREATE TABLE with_filename(host string, cpu double, memory double, ts timestamp time index); | ||
|
||
Copy with_filename FROM '/tmp/demo/export/demo.parquet_1_2'; | ||
|
||
select * from with_filename order by ts; | ||
|
||
CREATE TABLE with_path(host string, cpu double, memory double, ts timestamp time index); | ||
|
||
Copy with_path FROM '/tmp/demo/export/'; | ||
|
||
select * from with_path order by ts; | ||
|
||
CREATE TABLE with_pattern(host string, cpu double, memory double, ts timestamp time index); | ||
|
||
Copy with_pattern FROM '/tmp/demo/export/' WITH (PATTERN = 'demo.*'); | ||
|
||
select * from with_pattern order by ts; | ||
|
||
drop table demo; | ||
|
||
drop table with_filename; | ||
|
||
drop table with_path; | ||
|
||
drop table with_pattern; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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/export/demo.parquet'; | ||
|
||
Affected Rows: 2 | ||
|
||
drop table demo; | ||
|
||
Affected Rows: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE demo(host string, cpu double, memory double, ts TIMESTAMP time index); | ||
|
||
insert into demo(host, cpu, memory, ts) values ('host1', 66.6, 1024, 1655276557000), ('host2', 88.8, 333.3, 1655276558000); | ||
|
||
Copy demo TO '/tmp/export/demo.parquet'; | ||
|
||
drop table demo; |