postgres: add snapshot tests (#79794)
* postgres: add snapshot tests * fixed wrong comment Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com> --------- Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
This commit is contained in:
Vendored
+93
@@ -0,0 +1,93 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "type": "timeseries-wide",
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 3 Fields by 5 Rows
|
||||
// +-------------------------------+------------------+------------------+
|
||||
// | Name: Time | Name: a | Name: b |
|
||||
// | Labels: | Labels: | Labels: |
|
||||
// | Type: []time.Time | Type: []*float64 | Type: []*float64 |
|
||||
// +-------------------------------+------------------+------------------+
|
||||
// | 2023-12-24 14:30:03 +0000 UTC | 10 | 110 |
|
||||
// | 2023-12-24 14:31:03 +0000 UTC | 20 | 120 |
|
||||
// | 2023-12-24 14:32:03 +0000 UTC | 30 | 130 |
|
||||
// | 2023-12-24 14:33:03 +0000 UTC | 40 | 140 |
|
||||
// | 2023-12-24 14:34:03 +0000 UTC | 50 | 150 |
|
||||
// +-------------------------------+------------------+------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"type": "timeseries-wide",
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "Time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "a",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "b",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703428203000,
|
||||
1703428263000,
|
||||
1703428323000,
|
||||
1703428383000,
|
||||
1703428443000
|
||||
],
|
||||
[
|
||||
10,
|
||||
20,
|
||||
30,
|
||||
40,
|
||||
50
|
||||
],
|
||||
[
|
||||
110,
|
||||
120,
|
||||
130,
|
||||
140,
|
||||
150
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
-- SELECT * FROM tbl
|
||||
-- there's special backward-compat code which handles a field named 'metric'
|
||||
CREATE TEMPORARY TABLE tbl (
|
||||
"time" timestamp with time zone,
|
||||
v double precision,
|
||||
metric text
|
||||
);
|
||||
|
||||
INSERT INTO tbl ("time", v, metric) VALUES
|
||||
('2023-12-24 14:30:03 UTC', 10, 'a'),
|
||||
('2023-12-24 14:30:03 UTC', 110, 'b'),
|
||||
('2023-12-24 14:31:03 UTC', 20, 'a'),
|
||||
('2023-12-24 14:31:03 UTC', 120, 'b'),
|
||||
('2023-12-24 14:32:03 UTC', 30, 'a'),
|
||||
('2023-12-24 14:32:03 UTC', 130, 'b'),
|
||||
('2023-12-24 14:33:03 UTC', 40, 'a'),
|
||||
('2023-12-24 14:33:03 UTC', 140, 'b'),
|
||||
('2023-12-24 14:34:03 UTC', 50, 'a'),
|
||||
('2023-12-24 14:34:03 UTC', 150, 'b');
|
||||
Vendored
+245
@@ -0,0 +1,245 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "type": "timeseries-wide",
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 11 Fields by 1 Rows
|
||||
// +-------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
|
||||
// | Name: Time | Name: v1 | Name: v1nn | Name: v2 | Name: v2nn | Name: x1 | Name: x1nn | Name: x2 | Name: x2nn | Name: x3 | Name: x3nn |
|
||||
// | Labels: | Labels: c1=one, c1nn=two, c2=three, c2nn=four, c3=five , c3nn=six | Labels: c1=one, c1nn=two, c2=three, c2nn=four, c3=five , c3nn=six | Labels: c1=one, c1nn=two, c2=three, c2nn=four, c3=five , c3nn=six | Labels: c1=one, c1nn=two, c2=three, c2nn=four, c3=five , c3nn=six | Labels: c1=one, c1nn=two, c2=three, c2nn=four, c3=five , c3nn=six | Labels: c1=one, c1nn=two, c2=three, c2nn=four, c3=five , c3nn=six | Labels: c1=one, c1nn=two, c2=three, c2nn=four, c3=five , c3nn=six | Labels: c1=one, c1nn=two, c2=three, c2nn=four, c3=five , c3nn=six | Labels: c1=one, c1nn=two, c2=three, c2nn=four, c3=five , c3nn=six | Labels: c1=one, c1nn=two, c2=three, c2nn=four, c3=five , c3nn=six |
|
||||
// | Type: []time.Time | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 |
|
||||
// +-------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
|
||||
// | 2023-12-21 11:30:03 +0000 UTC | 10.1 | 11.1 | 12.1 | 13.1 | 101 | 102 | 103 | 104 | 105 | 106 |
|
||||
// +-------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"type": "timeseries-wide",
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "Time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v1",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c1": "one",
|
||||
"c1nn": "two",
|
||||
"c2": "three",
|
||||
"c2nn": "four",
|
||||
"c3": "five ",
|
||||
"c3nn": "six "
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v1nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c1": "one",
|
||||
"c1nn": "two",
|
||||
"c2": "three",
|
||||
"c2nn": "four",
|
||||
"c3": "five ",
|
||||
"c3nn": "six "
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c1": "one",
|
||||
"c1nn": "two",
|
||||
"c2": "three",
|
||||
"c2nn": "four",
|
||||
"c3": "five ",
|
||||
"c3nn": "six "
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v2nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c1": "one",
|
||||
"c1nn": "two",
|
||||
"c2": "three",
|
||||
"c2nn": "four",
|
||||
"c3": "five ",
|
||||
"c3nn": "six "
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x1",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c1": "one",
|
||||
"c1nn": "two",
|
||||
"c2": "three",
|
||||
"c2nn": "four",
|
||||
"c3": "five ",
|
||||
"c3nn": "six "
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x1nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c1": "one",
|
||||
"c1nn": "two",
|
||||
"c2": "three",
|
||||
"c2nn": "four",
|
||||
"c3": "five ",
|
||||
"c3nn": "six "
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x2",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c1": "one",
|
||||
"c1nn": "two",
|
||||
"c2": "three",
|
||||
"c2nn": "four",
|
||||
"c3": "five ",
|
||||
"c3nn": "six "
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x2nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c1": "one",
|
||||
"c1nn": "two",
|
||||
"c2": "three",
|
||||
"c2nn": "four",
|
||||
"c3": "five ",
|
||||
"c3nn": "six "
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x3",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c1": "one",
|
||||
"c1nn": "two",
|
||||
"c2": "three",
|
||||
"c2nn": "four",
|
||||
"c3": "five ",
|
||||
"c3nn": "six "
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x3nn",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c1": "one",
|
||||
"c1nn": "two",
|
||||
"c2": "three",
|
||||
"c2nn": "four",
|
||||
"c3": "five ",
|
||||
"c3nn": "six "
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703158203000
|
||||
],
|
||||
[
|
||||
10.1
|
||||
],
|
||||
[
|
||||
11.1
|
||||
],
|
||||
[
|
||||
12.1
|
||||
],
|
||||
[
|
||||
13.1
|
||||
],
|
||||
[
|
||||
101
|
||||
],
|
||||
[
|
||||
102
|
||||
],
|
||||
[
|
||||
103
|
||||
],
|
||||
[
|
||||
104
|
||||
],
|
||||
[
|
||||
105
|
||||
],
|
||||
[
|
||||
106
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
-- SELECT * FROM tbl
|
||||
-- in timeseries mode, most fields gets converted to float6
|
||||
CREATE TEMPORARY TABLE tbl (
|
||||
"time" timestamp with time zone,
|
||||
v1 double precision,
|
||||
v1nn double precision NOT NULL,
|
||||
v2 real,
|
||||
v2nn real NOT NULL,
|
||||
c1 text,
|
||||
c1nn text NOT NULL,
|
||||
c2 varchar(10),
|
||||
c2nn varchar(10) NOT NULL,
|
||||
c3 char(10),
|
||||
c3nn char(10) NOT NULL,
|
||||
x1 smallint,
|
||||
x1nn smallint NOT NULL,
|
||||
x2 integer,
|
||||
x2nn integer NOT NULL,
|
||||
x3 bigint,
|
||||
x3nn bigint NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO tbl ("time",
|
||||
v1, v1nn, v2, v2nn,
|
||||
c1, c1nn, c2, c2nn, c3, c3nn,
|
||||
x1, x1nn, x2, x2nn, x3, x3nn) VALUES
|
||||
('2023-12-21 11:30:03 UTC',
|
||||
10.1, 11.1, 12.1, 13.1,
|
||||
'one', 'two', 'three', 'four', 'five', 'six',
|
||||
101, 102, 103, 104, 105, 106);
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "type": "timeseries-wide",
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT floor(extract(epoch from \"time\")/300)*300 AS \"time\",c,avg(v) AS \"v\" FROM tbl GROUP BY 1,2 ORDER BY 1,2"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 3 Fields by 7 Rows
|
||||
// +-------------------------------+------------------+------------------+
|
||||
// | Name: Time | Name: v | Name: v |
|
||||
// | Labels: | Labels: c=a | Labels: c=b |
|
||||
// | Type: []time.Time | Type: []*float64 | Type: []*float64 |
|
||||
// +-------------------------------+------------------+------------------+
|
||||
// | 2023-12-24 15:15:00 +0100 CET | null | null |
|
||||
// | 2023-12-24 15:20:00 +0100 CET | 15 | 115 |
|
||||
// | 2023-12-24 15:25:00 +0100 CET | null | null |
|
||||
// | 2023-12-24 15:30:00 +0100 CET | null | null |
|
||||
// | 2023-12-24 15:35:00 +0100 CET | 50 | 150 |
|
||||
// | 2023-12-24 15:40:00 +0100 CET | null | null |
|
||||
// | 2023-12-24 15:45:00 +0100 CET | null | null |
|
||||
// +-------------------------------+------------------+------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"type": "timeseries-wide",
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT floor(extract(epoch from \"time\")/300)*300 AS \"time\",c,avg(v) AS \"v\" FROM tbl GROUP BY 1,2 ORDER BY 1,2"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "Time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c": "a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c": "b"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703427300000,
|
||||
1703427600000,
|
||||
1703427900000,
|
||||
1703428200000,
|
||||
1703428500000,
|
||||
1703428800000,
|
||||
1703429100000
|
||||
],
|
||||
[
|
||||
null,
|
||||
15,
|
||||
null,
|
||||
null,
|
||||
50,
|
||||
null,
|
||||
null
|
||||
],
|
||||
[
|
||||
null,
|
||||
115,
|
||||
null,
|
||||
null,
|
||||
150,
|
||||
null,
|
||||
null
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
-- SELECT $__timeGroup("time",5m,NULL),c,avg(v) AS "v" FROM tbl GROUP BY 1,2 ORDER BY 1,2
|
||||
-- tests fill-mode=null
|
||||
CREATE TEMPORARY TABLE tbl (
|
||||
"time" timestamp with time zone,
|
||||
v double precision,
|
||||
c text
|
||||
);
|
||||
|
||||
INSERT INTO tbl ("time", v, c) VALUES
|
||||
('2023-12-24 14:21:03 UTC', 10, 'a'),
|
||||
('2023-12-24 14:21:03 UTC', 110, 'b'),
|
||||
('2023-12-24 14:23:03 UTC', 20, 'a'),
|
||||
('2023-12-24 14:23:03 UTC', 120, 'b'),
|
||||
('2023-12-24 14:39:03 UTC', 50, 'a'),
|
||||
('2023-12-24 14:39:03 UTC', 150, 'b');
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "type": "timeseries-wide",
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT floor(extract(epoch from \"time\")/300)*300 AS \"time\",c,avg(v) AS \"v\" FROM tbl GROUP BY 1,2 ORDER BY 1,2"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 3 Fields by 7 Rows
|
||||
// +-------------------------------+------------------+------------------+
|
||||
// | Name: Time | Name: v | Name: v |
|
||||
// | Labels: | Labels: c=a | Labels: c=b |
|
||||
// | Type: []time.Time | Type: []*float64 | Type: []*float64 |
|
||||
// +-------------------------------+------------------+------------------+
|
||||
// | 2023-12-24 15:15:00 +0100 CET | null | null |
|
||||
// | 2023-12-24 15:20:00 +0100 CET | 15 | 115 |
|
||||
// | 2023-12-24 15:25:00 +0100 CET | 15 | 115 |
|
||||
// | 2023-12-24 15:30:00 +0100 CET | 15 | 115 |
|
||||
// | 2023-12-24 15:35:00 +0100 CET | 50 | 150 |
|
||||
// | 2023-12-24 15:40:00 +0100 CET | 50 | 150 |
|
||||
// | 2023-12-24 15:45:00 +0100 CET | 50 | 150 |
|
||||
// +-------------------------------+------------------+------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"type": "timeseries-wide",
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT floor(extract(epoch from \"time\")/300)*300 AS \"time\",c,avg(v) AS \"v\" FROM tbl GROUP BY 1,2 ORDER BY 1,2"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "Time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c": "a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c": "b"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703427300000,
|
||||
1703427600000,
|
||||
1703427900000,
|
||||
1703428200000,
|
||||
1703428500000,
|
||||
1703428800000,
|
||||
1703429100000
|
||||
],
|
||||
[
|
||||
null,
|
||||
15,
|
||||
15,
|
||||
15,
|
||||
50,
|
||||
50,
|
||||
50
|
||||
],
|
||||
[
|
||||
null,
|
||||
115,
|
||||
115,
|
||||
115,
|
||||
150,
|
||||
150,
|
||||
150
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
-- SELECT $__timeGroup("time",5m,previous),c,avg(v) AS "v" FROM tbl GROUP BY 1,2 ORDER BY 1,2
|
||||
-- tests fill-mode=previous
|
||||
CREATE TEMPORARY TABLE tbl (
|
||||
"time" timestamp with time zone,
|
||||
v double precision,
|
||||
c text
|
||||
);
|
||||
|
||||
INSERT INTO tbl ("time", v, c) VALUES
|
||||
('2023-12-24 14:21:03 UTC', 10, 'a'),
|
||||
('2023-12-24 14:21:03 UTC', 110, 'b'),
|
||||
('2023-12-24 14:23:03 UTC', 20, 'a'),
|
||||
('2023-12-24 14:23:03 UTC', 120, 'b'),
|
||||
('2023-12-24 14:39:03 UTC', 50, 'a'),
|
||||
('2023-12-24 14:39:03 UTC', 150, 'b');
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "type": "timeseries-wide",
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT floor(extract(epoch from \"time\")/300)*300 AS \"time\",c,avg(v) AS \"v\" FROM tbl GROUP BY 1,2 ORDER BY 1,2"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 3 Fields by 7 Rows
|
||||
// +-------------------------------+------------------+------------------+
|
||||
// | Name: Time | Name: v | Name: v |
|
||||
// | Labels: | Labels: c=a | Labels: c=b |
|
||||
// | Type: []time.Time | Type: []*float64 | Type: []*float64 |
|
||||
// +-------------------------------+------------------+------------------+
|
||||
// | 2023-12-24 15:15:00 +0100 CET | 27 | 27 |
|
||||
// | 2023-12-24 15:20:00 +0100 CET | 15 | 115 |
|
||||
// | 2023-12-24 15:25:00 +0100 CET | 27 | 27 |
|
||||
// | 2023-12-24 15:30:00 +0100 CET | 27 | 27 |
|
||||
// | 2023-12-24 15:35:00 +0100 CET | 50 | 150 |
|
||||
// | 2023-12-24 15:40:00 +0100 CET | 27 | 27 |
|
||||
// | 2023-12-24 15:45:00 +0100 CET | 27 | 27 |
|
||||
// +-------------------------------+------------------+------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"type": "timeseries-wide",
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT floor(extract(epoch from \"time\")/300)*300 AS \"time\",c,avg(v) AS \"v\" FROM tbl GROUP BY 1,2 ORDER BY 1,2"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "Time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c": "a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c": "b"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703427300000,
|
||||
1703427600000,
|
||||
1703427900000,
|
||||
1703428200000,
|
||||
1703428500000,
|
||||
1703428800000,
|
||||
1703429100000
|
||||
],
|
||||
[
|
||||
27,
|
||||
15,
|
||||
27,
|
||||
27,
|
||||
50,
|
||||
27,
|
||||
27
|
||||
],
|
||||
[
|
||||
27,
|
||||
115,
|
||||
27,
|
||||
27,
|
||||
150,
|
||||
27,
|
||||
27
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
-- SELECT $__timeGroup("time",5m,27),c,avg(v) AS "v" FROM tbl GROUP BY 1,2 ORDER BY 1,2
|
||||
-- tests fill-mode=value
|
||||
CREATE TEMPORARY TABLE tbl (
|
||||
"time" timestamp with time zone,
|
||||
v double precision,
|
||||
c text
|
||||
);
|
||||
|
||||
INSERT INTO tbl ("time", v, c) VALUES
|
||||
('2023-12-24 14:21:03 UTC', 10, 'a'),
|
||||
('2023-12-24 14:21:03 UTC', 110, 'b'),
|
||||
('2023-12-24 14:23:03 UTC', 20, 'a'),
|
||||
('2023-12-24 14:23:03 UTC', 120, 'b'),
|
||||
('2023-12-24 14:39:03 UTC', 50, 'a'),
|
||||
('2023-12-24 14:39:03 UTC', 150, 'b');
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
//
|
||||
// Frame[0] {
|
||||
// "type": "timeseries-wide",
|
||||
// "typeVersion": [
|
||||
// 0,
|
||||
// 0
|
||||
// ],
|
||||
// "executedQueryString": "SELECT * FROM tbl"
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 3 Fields by 5 Rows
|
||||
// +-------------------------------+------------------+------------------+
|
||||
// | Name: Time | Name: v | Name: v |
|
||||
// | Labels: | Labels: c=a | Labels: c=b |
|
||||
// | Type: []time.Time | Type: []*float64 | Type: []*float64 |
|
||||
// +-------------------------------+------------------+------------------+
|
||||
// | 2023-12-24 14:30:03 +0000 UTC | 10 | 110 |
|
||||
// | 2023-12-24 14:31:03 +0000 UTC | 20 | 120 |
|
||||
// | 2023-12-24 14:32:03 +0000 UTC | 30 | 130 |
|
||||
// | 2023-12-24 14:33:03 +0000 UTC | 40 | 140 |
|
||||
// | 2023-12-24 14:34:03 +0000 UTC | 50 | 150 |
|
||||
// +-------------------------------+------------------+------------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
{
|
||||
"status": 200,
|
||||
"frames": [
|
||||
{
|
||||
"schema": {
|
||||
"meta": {
|
||||
"type": "timeseries-wide",
|
||||
"typeVersion": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"executedQueryString": "SELECT * FROM tbl"
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"name": "Time",
|
||||
"type": "time",
|
||||
"typeInfo": {
|
||||
"frame": "time.Time"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c": "a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "v",
|
||||
"type": "number",
|
||||
"typeInfo": {
|
||||
"frame": "float64",
|
||||
"nullable": true
|
||||
},
|
||||
"labels": {
|
||||
"c": "b"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
1703428203000,
|
||||
1703428263000,
|
||||
1703428323000,
|
||||
1703428383000,
|
||||
1703428443000
|
||||
],
|
||||
[
|
||||
10,
|
||||
20,
|
||||
30,
|
||||
40,
|
||||
50
|
||||
],
|
||||
[
|
||||
110,
|
||||
120,
|
||||
130,
|
||||
140,
|
||||
150
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
-- SELECT * FROM tbl
|
||||
CREATE TEMPORARY TABLE tbl (
|
||||
"time" timestamp with time zone,
|
||||
v double precision,
|
||||
c text
|
||||
);
|
||||
|
||||
INSERT INTO tbl ("time", v, c) VALUES
|
||||
('2023-12-24 14:30:03 UTC', 10, 'a'),
|
||||
('2023-12-24 14:30:03 UTC', 110, 'b'),
|
||||
('2023-12-24 14:31:03 UTC', 20, 'a'),
|
||||
('2023-12-24 14:31:03 UTC', 120, 'b'),
|
||||
('2023-12-24 14:32:03 UTC', 30, 'a'),
|
||||
('2023-12-24 14:32:03 UTC', 130, 'b'),
|
||||
('2023-12-24 14:33:03 UTC', 40, 'a'),
|
||||
('2023-12-24 14:33:03 UTC', 140, 'b'),
|
||||
('2023-12-24 14:34:03 UTC', 50, 'a'),
|
||||
('2023-12-24 14:34:03 UTC', 150, 'b');
|
||||
Reference in New Issue
Block a user