forked from apache/horaedb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support integration tests for influxql (apache#719)
* feat: support integration tests for influxql * update the testcases for influxql * update cargo.lock * revert issue-302 test case * Update Cargo.toml Co-authored-by: Jiacai Liu <dev@liujiacai.net> * address CR * fix wrong usage of sqlness arg --------- Co-authored-by: Jiacai Liu <dev@liujiacai.net>
- Loading branch information
1 parent
7640eec
commit 3899404
Showing
5 changed files
with
180 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,40 @@ | ||
DROP TABLE IF EXISTS `h2o_feet`; | ||
|
||
affected_rows: 0 | ||
|
||
CREATE TABLE `h2o_feet` ( | ||
`time` timestamp NOT NULL, | ||
`level_description` string TAG, | ||
`location` string TAG, | ||
`water_level` double NOT NULL, | ||
timestamp KEY (time)) ENGINE = Analytic WITH ( | ||
enable_ttl = 'false' | ||
); | ||
|
||
affected_rows: 0 | ||
|
||
INSERT INTO h2o_feet(time, level_description, location, water_level) | ||
VALUES | ||
(1439827200000, "between 6 and 9 feet", "coyote_creek", 8.12), | ||
(1439827200000, "below 3 feet", "santa_monica", 2.064), | ||
(1439827560000, "between 6 and 9 feet", "coyote_creek", 8.005), | ||
(1439827560000, "below 3 feet", "santa_monica", 2.116), | ||
(1439827620000, "between 6 and 9 feet", "coyote_creek", 7.887), | ||
(1439827620000, "below 3 feet", "santa_monica", 2.028); | ||
|
||
affected_rows: 6 | ||
|
||
-- SQLNESS ARG protocol=influxql | ||
SELECT * FROM "h2o_feet"; | ||
|
||
{"rows":[{"level_description":"between 6 and 9 feet","location":"coyote_creek","water_level":8.12},{"level_description":"between 6 and 9 feet","location":"coyote_creek","water_level":8.005},{"level_description":"between 6 and 9 feet","location":"coyote_creek","water_level":7.887},{"level_description":"below 3 feet","location":"santa_monica","water_level":2.064},{"level_description":"below 3 feet","location":"santa_monica","water_level":2.116},{"level_description":"below 3 feet","location":"santa_monica","water_level":2.028}]} | ||
|
||
-- SQLNESS ARG protocol=influxql | ||
SELECT "level_description", location, water_level FROM "h2o_feet" where location = 'santa_monica'; | ||
|
||
{"rows":[{"level_description":"below 3 feet","location":"santa_monica","water_level":2.064},{"level_description":"below 3 feet","location":"santa_monica","water_level":2.116},{"level_description":"below 3 feet","location":"santa_monica","water_level":2.028}]} | ||
|
||
DROP TABLE IF EXISTS `h2o_feet`; | ||
|
||
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,35 @@ | ||
DROP TABLE IF EXISTS `h2o_feet`; | ||
|
||
CREATE TABLE `h2o_feet` ( | ||
`time` timestamp NOT NULL, | ||
`level_description` string TAG, | ||
`location` string TAG, | ||
`water_level` double NOT NULL, | ||
timestamp KEY (time)) ENGINE = Analytic WITH ( | ||
enable_ttl = 'false' | ||
); | ||
|
||
-- Insert Records: | ||
-- ("2015-08-18T00:00:00Z", "between 6 and 9 feet", "coyote_creek", 8.12), | ||
-- ("2015-08-18T00:00:00Z", "below 3 feet", "santa_monica", 2.064), | ||
-- ("2015-08-18T00:06:00Z", "between 6 and 9 feet", "coyote_creek", 8.005), | ||
-- ("2015-08-18T00:06:00Z", "below 3 feet", "santa_monica", 2.116), | ||
-- ("2015-08-18T00:12:00Z", "between 6 and 9 feet", "coyote_creek", 7.887), | ||
-- ("2015-08-18T00:12:00Z", "below 3 feet", "santa_monica", 2.028); | ||
INSERT INTO h2o_feet(time, level_description, location, water_level) | ||
VALUES | ||
(1439827200000, "between 6 and 9 feet", "coyote_creek", 8.12), | ||
(1439827200000, "below 3 feet", "santa_monica", 2.064), | ||
(1439827560000, "between 6 and 9 feet", "coyote_creek", 8.005), | ||
(1439827560000, "below 3 feet", "santa_monica", 2.116), | ||
(1439827620000, "between 6 and 9 feet", "coyote_creek", 7.887), | ||
(1439827620000, "below 3 feet", "santa_monica", 2.028); | ||
|
||
|
||
-- SQLNESS ARG protocol=influxql | ||
SELECT * FROM "h2o_feet"; | ||
|
||
-- SQLNESS ARG protocol=influxql | ||
SELECT "level_description", location, water_level FROM "h2o_feet" where location = 'santa_monica'; | ||
|
||
DROP TABLE IF EXISTS `h2o_feet`; |
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