Skip to content

Commit

Permalink
fix: sqlness result error
Browse files Browse the repository at this point in the history
  • Loading branch information
poltao committed Jul 27, 2024
1 parent aee7610 commit 6ba0818
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
33 changes: 20 additions & 13 deletions tests/cases/standalone/common/copy/copy_from_fs_parquet.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ CREATE TABLE demo(host string, cpu double, memory double, ts TIMESTAMP time inde

Affected Rows: 0

CREATE TABLE demo_2(host string, cpu double, memory double, ts TIMESTAMP time index);

Affected Rows: 0

insert into
demo(host, cpu, memory, ts)
values
Expand All @@ -11,21 +15,22 @@ values

Affected Rows: 3

Copy demo TO '/tmp/demo/export/parquet_files/demo.parquet';
insert into
demo_2(host, cpu, memory, ts)
values
('host4', 77.7, 1111, 1655276555000),
('host5', 99.9, 444.4, 1655276556000),
('host6', 222.2, 555.5, 1722077264000);

Affected Rows: 3

CREATE TABLE demo_2(host string, cpu double, memory double, ts TIMESTAMP time index);

Affected Rows: 0

insert into demo_2(host, cpu, memory, ts) values ('host4', 77.7, 1111, 1655276555000), ('host5', 99.9, 444.4, 1655276556000);
Copy demo TO '/tmp/demo/export/parquet_files/demo.parquet';

Affected Rows: 2
Affected Rows: 3

Copy demo_2 TO '/tmp/demo/export/parquet_files/demo_2.parquet';

Affected Rows: 2
Affected Rows: 3

CREATE TABLE with_filename(host string, cpu double, memory double, ts timestamp time index);

Expand All @@ -50,7 +55,7 @@ Affected Rows: 0

Copy with_path FROM '/tmp/demo/export/parquet_files/';

Affected Rows: 5
Affected Rows: 6

select * from with_path order by ts;

Expand All @@ -62,6 +67,7 @@ select * from with_path order by ts;
| host1 | 66.6 | 1024.0 | 2022-06-15T07:02:37 |
| host2 | 88.8 | 333.3 | 2022-06-15T07:02:38 |
| host3 | 111.1 | 444.4 | 2024-07-27T10:47:43 |
| host6 | 222.2 | 555.5 | 2024-07-27T10:47:44 |
+-------+-------+--------+---------------------+

CREATE TABLE with_pattern(host string, cpu double, memory double, ts timestamp time index);
Expand All @@ -70,14 +76,15 @@ Affected Rows: 0

Copy with_pattern FROM '/tmp/demo/export/parquet_files/' WITH (PATTERN = 'demo.*', start_time='2022-06-15 07:02:39');

Affected Rows: 1
Affected Rows: 2

select * from with_pattern order by ts;

+-------+-------+--------+---------------------+
| host | cpu | memory | ts |
+-------+-------+--------+---------------------+
| host3 | 111.1 | 444.4 | 2024-07-27T10:47:43 |
| host6 | 222.2 | 555.5 | 2024-07-27T10:47:44 |
+-------+-------+--------+---------------------+

CREATE TABLE without_limit_rows(host string, cpu double, memory double, ts timestamp time index);
Expand All @@ -86,21 +93,21 @@ Affected Rows: 0

Copy without_limit_rows FROM '/tmp/demo/export/parquet_files/';

Affected Rows: 5
Affected Rows: 6

select count(*) from without_limit_rows;

+----------+
| COUNT(*) |
+----------+
| 5 |
| 6 |
+----------+

CREATE TABLE with_limit_rows_segment(host string, cpu double, memory double, ts timestamp time index);

Affected Rows: 0

Copy with_limit_rows_segment FROM '/tmp/demo/export/parquet_files/' LIMIT 2;
Copy with_limit_rows_segment FROM '/tmp/demo/export/parquet_files/' LIMIT 3;

Affected Rows: 3

Expand Down
15 changes: 10 additions & 5 deletions tests/cases/standalone/common/copy/copy_from_fs_parquet.sql
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
CREATE TABLE demo(host string, cpu double, memory double, ts TIMESTAMP time index);

CREATE TABLE demo_2(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),
('host3', 111.1, 444.4, 1722077263000);

Copy demo TO '/tmp/demo/export/parquet_files/demo.parquet';

CREATE TABLE demo_2(host string, cpu double, memory double, ts TIMESTAMP time index);
insert into
demo_2(host, cpu, memory, ts)
values
('host4', 77.7, 1111, 1655276555000),
('host5', 99.9, 444.4, 1655276556000),
('host6', 222.2, 555.5, 1722077264000);

insert into demo_2(host, cpu, memory, ts) values ('host4', 77.7, 1111, 1655276555000), ('host5', 99.9, 444.4, 1655276556000);
Copy demo TO '/tmp/demo/export/parquet_files/demo.parquet';

Copy demo_2 TO '/tmp/demo/export/parquet_files/demo_2.parquet';

Expand Down Expand Up @@ -41,7 +46,7 @@ select count(*) from without_limit_rows;

CREATE TABLE with_limit_rows_segment(host string, cpu double, memory double, ts timestamp time index);

Copy with_limit_rows_segment FROM '/tmp/demo/export/parquet_files/' LIMIT 2;
Copy with_limit_rows_segment FROM '/tmp/demo/export/parquet_files/' LIMIT 3;

select count(*) from with_limit_rows_segment;

Expand Down

0 comments on commit 6ba0818

Please sign in to comment.