mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-09-06 21:48:58 +00:00
* fix(query): push down PromQL cast filters Signed-off-by: discord9 <discord9@163.com> * test(query): cover cast preimage pushdown Signed-off-by: discord9 <discord9@163.com> * test(query): expand cast preimage coverage Signed-off-by: discord9 <discord9@163.com> * test(query): compare cast normalization rules Signed-off-by: discord9 <discord9@163.com> * test(query): update cast pushdown sqlness plans Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com>
28 lines
880 B
SQL
28 lines
880 B
SQL
-- run PromQL on non-typical prometheus table schema
|
|
CREATE TABLE IF NOT EXISTS `cpu_usage` (
|
|
`job` STRING NULL,
|
|
`value` DOUBLE NULL,
|
|
`ts` TIMESTAMP(9) NOT NULL,
|
|
TIME INDEX (`ts`),
|
|
PRIMARY KEY (`job`)
|
|
)
|
|
ENGINE=mito
|
|
WITH(
|
|
merge_mode = 'last_non_null'
|
|
);
|
|
|
|
-- SQLNESS REPLACE (metrics.*) REDACTED
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (cpu_usage\.ts_range) ts_range
|
|
-- SQLNESS REPLACE (cpu_usage\.ts) ts
|
|
-- SQLNESS REPLACE (?m)^\|_\|_\|_SortExec:.*\n\|_\|_\|_RepartitionExec:.*\n
|
|
-- SQLNESS REPLACE (SeriesScan:.*|SeqScan:.*) ScanExec: REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
|
|
TQL analyze (0, 10, '1s') sum by(job) (irate(cpu_usage{job="fire"}[5s])) / 1e9;
|
|
|
|
drop table `cpu_usage`;
|