mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-16 17:02:33 +00:00
* fix(promql): restore exact filtering for nullable label matchers
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test: verify compound filter semantics and last-row selection
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test: consolidate label filter regression coverage
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* refactor: separate filter evaluation and timestamp adaptation
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* refactor: inline predicate and timestamp tests
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* refactor: keep direct IN predicates outside simple filters
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix: coerce partition bounds before simple filtering
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test: cover partition bound overflow after timestamp widening
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
(cherry picked from commit 526dd48bda)
Signed-off-by: WenyXu <wenymedia@gmail.com>
73 lines
2.3 KiB
SQL
73 lines
2.3 KiB
SQL
CREATE TABLE test (
|
|
ts timestamp(3) time index,
|
|
host STRING,
|
|
val BIGINT,
|
|
PRIMARY KEY(host),
|
|
);
|
|
|
|
INSERT INTO TABLE test VALUES
|
|
(0, '10.0.160.237:8080', 1),
|
|
(0, '10.0.160.237:8081', 1);
|
|
|
|
SELECT * FROM test;
|
|
|
|
TQL EVAL (0, 100, '15s') test{host=~"(10.0.160.237:8080|10.0.160.237:9090)"};
|
|
|
|
TQL EVAL (0, 100, '15s') test{host=~"10\\.0\\.160\\.237:808|nonexistence"};
|
|
|
|
TQL EVAL (0, 100, '15s') test{host=~"(10\\.0\\.160\\.237:8080|10\\.0\\.160\\.237:9090)"};
|
|
|
|
-- Some radical regex optimization
|
|
|
|
-- SQLNESS REPLACE (metrics.*) REDACTED
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
|
|
-- SQLNESS REPLACE (flat_format.*) REDACTED
|
|
TQL ANALYZE VERBOSE (0, 0, '1s') test{host=~".*"};
|
|
|
|
-- SQLNESS REPLACE (metrics.*) REDACTED
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
|
|
-- SQLNESS REPLACE (flat_format.*) REDACTED
|
|
TQL ANALYZE VERBOSE (0, 0, '1s') test{host=~".+"};
|
|
|
|
-- SQLNESS REPLACE (metrics.*) REDACTED
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
|
|
-- SQLNESS REPLACE (flat_format.*) REDACTED
|
|
TQL ANALYZE VERBOSE (0, 0, '1s') test{host!~".*"};
|
|
|
|
-- SQLNESS REPLACE (metrics.*) REDACTED
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
|
|
-- SQLNESS REPLACE (flat_format.*) REDACTED
|
|
TQL ANALYZE VERBOSE (0, 0, '1s') test{host!~".+"};
|
|
|
|
INSERT INTO test VALUES (0, NULL, 2), (0, '', 3), (0, 'ext4', 4), (0, 'tmpfs', 5);
|
|
|
|
TQL EVAL (0, 0, '1s') test{host!="tmpfs"};
|
|
TQL EVAL (0, 0, '1s') test{host!~"tmpfs|vfat"};
|
|
TQL EVAL (0, 0, '1s') test{host=""};
|
|
TQL EVAL (0, 0, '1s') test{host!=""};
|
|
TQL EVAL (0, 0, '1s') test{host=~"ext4|"};
|
|
TQL EVAL (0, 0, '1s') test{host!~"ext4|"};
|
|
TQL EVAL (0, 0, '1s') test{missing!="lo"};
|
|
|
|
DROP TABLE test;
|