-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: count_wildcard_to_time_index_rule doesn't handle table reference…
… properly (#3847) * validate time index col Signed-off-by: Ruihang Xia <[email protected]> * use TableReference instead Signed-off-by: Ruihang Xia <[email protected]> * add more tests Signed-off-by: Ruihang Xia <[email protected]> --------- Signed-off-by: Ruihang Xia <[email protected]>
- Loading branch information
Showing
3 changed files
with
145 additions
and
9 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,56 @@ | ||
create table "HelloWorld" (a string, b timestamp time index); | ||
|
||
Affected Rows: 0 | ||
|
||
insert into "HelloWorld" values ("a", 1) ,("b", 2); | ||
|
||
Affected Rows: 2 | ||
|
||
select count(*) from "HelloWorld"; | ||
|
||
+----------+ | ||
| COUNT(*) | | ||
+----------+ | ||
| 2 | | ||
+----------+ | ||
|
||
create table test (a string, "BbB" timestamp time index); | ||
|
||
Affected Rows: 0 | ||
|
||
insert into test values ("c", 1) ; | ||
|
||
Affected Rows: 1 | ||
|
||
select count(*) from test; | ||
|
||
+----------+ | ||
| COUNT(*) | | ||
+----------+ | ||
| 1 | | ||
+----------+ | ||
|
||
select count(*) from (select count(*) from test where a = 'a'); | ||
|
||
+----------+ | ||
| COUNT(*) | | ||
+----------+ | ||
| 1 | | ||
+----------+ | ||
|
||
select count(*) from (select * from test cross join "HelloWorld"); | ||
|
||
+----------+ | ||
| COUNT(*) | | ||
+----------+ | ||
| 2 | | ||
+----------+ | ||
|
||
drop table "HelloWorld"; | ||
|
||
Affected Rows: 0 | ||
|
||
drop table test; | ||
|
||
Affected Rows: 0 | ||
|
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,19 @@ | ||
create table "HelloWorld" (a string, b timestamp time index); | ||
|
||
insert into "HelloWorld" values ("a", 1) ,("b", 2); | ||
|
||
select count(*) from "HelloWorld"; | ||
|
||
create table test (a string, "BbB" timestamp time index); | ||
|
||
insert into test values ("c", 1) ; | ||
|
||
select count(*) from test; | ||
|
||
select count(*) from (select count(*) from test where a = 'a'); | ||
|
||
select count(*) from (select * from test cross join "HelloWorld"); | ||
|
||
drop table "HelloWorld"; | ||
|
||
drop table test; |