MySQL: snapshot tests (#84846)

mysql: add snapshot tests
This commit is contained in:
Gábor Farkas
2024-03-26 10:24:33 +01:00
committed by GitHub
parent c835022861
commit 3b7ee3a56b
41 changed files with 3006 additions and 0 deletions
@@ -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
]
]
}
}
]
}
@@ -0,0 +1,19 @@
-- SELECT * FROM tbl
-- there's special backward-compat code which handles a field named 'metric'
CREATE TABLE tbl (
`time` timestamp NOT NULL,
v double precision,
metric text
);
INSERT INTO tbl (`time`, v, metric) VALUES
('2023-12-24 14:30:03+00:00', 10, 'a'),
('2023-12-24 14:30:03+00:00', 110, 'b'),
('2023-12-24 14:31:03+00:00', 20, 'a'),
('2023-12-24 14:31:03+00:00', 120, 'b'),
('2023-12-24 14:32:03+00:00', 30, 'a'),
('2023-12-24 14:32:03+00:00', 130, 'b'),
('2023-12-24 14:33:03+00:00', 40, 'a'),
('2023-12-24 14:33:03+00:00', 140, 'b'),
('2023-12-24 14:34:03+00:00', 50, 'a'),
('2023-12-24 14:34:03+00:00', 150, 'b');
@@ -0,0 +1,267 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "type": "timeseries-wide",
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl"
// }
// Name:
// Dimensions: 15 Fields by 2 Rows
// +-------------------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+
// | Name: Time | Name: v1 | Name: v1nn | Name: v2 | Name: v2nn | Name: x1 | Name: x1nn | Name: x2 | Name: x2nn | Name: x3 | Name: x3nn | Name: x4 | Name: x4nn | Name: x5 | Name: x5nn |
// | Labels: | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one | Labels: t=one |
// | Type: []time.Time | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | 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 | 3.78125 | 451.5625 | 52.25 | 511.312 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 |
// | 2023-12-21 11:31:03 +0000 UTC | null | 464.375 | null | 346.125 | null | 127 | null | 204 | null | 206 | null | 208 | null | 210 |
// +-------------------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+
//
//
// 🌟 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": {
"t": "one"
}
},
{
"name": "v1nn",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "v2",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "v2nn",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "x1",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "x1nn",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "x2",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "x2nn",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "x3",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "x3nn",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "x4",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "x4nn",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "x5",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
},
{
"name": "x5nn",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"t": "one"
}
}
]
},
"data": {
"values": [
[
1703158203000,
1703158263000
],
[
3.78125,
null
],
[
451.5625,
464.375
],
[
52.25,
null
],
[
511.312,
346.125
],
[
101,
null
],
[
102,
127
],
[
103,
null
],
[
104,
204
],
[
105,
null
],
[
106,
206
],
[
107,
null
],
[
108,
208
],
[
109,
null
],
[
110,
210
]
]
}
}
]
}
@@ -0,0 +1,33 @@
-- SELECT * FROM tbl
-- in timeseries mode, most fields gets converted to float64
CREATE TABLE tbl (
"time" timestamp NOT NULL,
v1 double precision,
v1nn double precision NOT NULL,
v2 float,
v2nn float NOT NULL,
t text,
x1 tinyint,
x1nn tinyint NOT NULL,
x2 smallint,
x2nn smallint NOT NULL,
x3 mediumint,
x3nn mediumint NOT NULL,
x4 integer,
x4nn integer NOT NULL,
x5 bigint,
x5nn bigint NOT NULL
);
INSERT INTO tbl ("time",
v1, v1nn, v2, v2nn,
t,
x1, x1nn, x2, x2nn, x3, x3nn, x4, x4nn, x5, x5nn) VALUES
('2023-12-21 11:30:03 UTC',
3.78125, 451.5625, 52.25, 511.3125,
'one',
101, 102, 103, 104, 105, 106, 107, 108, 109, 110),
('2023-12-21 11:31:03 UTC',
NULL, 464.375, NULL, 346.125,
'one',
NULL, 202, NULL, 204, NULL, 206, NULL, 208, NULL, 210);
@@ -0,0 +1,113 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "type": "timeseries-wide",
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl"
// }
// Name:
// Dimensions: 3 Fields by 2 Rows
// +-------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
// | Name: Time | Name: v | Name: v |
// | Labels: | Labels: c1=, c1nn=bb, c2=, c2nn=dd, c3=, c3nn=ff, c4=, c4nn=hh, c5=, c5nn=jj, c6=, c6nn=ll, c7=, c7nn=v1 | Labels: c1=a, c1nn=b, c2=c, c2nn=d, c3=e, c3nn=f, c4=g, c4nn=h, c5=i, c5nn=j, c6=k, c6nn=l, c7=v1, c7nn=v2 |
// | Type: []time.Time | Type: []*float64 | Type: []*float64 |
// +-------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
// | 2023-12-21 11:30:03 +0000 UTC | null | 10.1 |
// | 2023-12-21 11:31:03 +0000 UTC | 20.1 | null |
// +-------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
//
//
// 🌟 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": {
"c1": "",
"c1nn": "bb",
"c2": "",
"c2nn": "dd",
"c3": "",
"c3nn": "ff",
"c4": "",
"c4nn": "hh",
"c5": "",
"c5nn": "jj",
"c6": "",
"c6nn": "ll",
"c7": "",
"c7nn": "v1"
}
},
{
"name": "v",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"c1": "a",
"c1nn": "b",
"c2": "c",
"c2nn": "d",
"c3": "e",
"c3nn": "f",
"c4": "g",
"c4nn": "h",
"c5": "i",
"c5nn": "j",
"c6": "k",
"c6nn": "l",
"c7": "v1",
"c7nn": "v2"
}
}
]
},
"data": {
"values": [
[
1703158203000,
1703158263000
],
[
null,
20.1
],
[
10.1,
null
]
]
}
}
]
}
@@ -0,0 +1,30 @@
-- SELECT * FROM tbl
-- in timeseries mode, most fields gets converted to float64, but text-fields should stay text
CREATE TABLE tbl (
"time" timestamp NOT NULL,
v double precision NOT NULL,
c1 varchar(10),
c1nn varchar(10) NOT NULL,
c2 char(10),
c2nn char(10) NOT NULL,
c3 tinytext,
c3nn tinytext NOT NULL,
c4 text,
c4nn text NOT NULL,
c5 mediumtext,
c5nn mediumtext NOT NULL,
c6 longtext,
c6nn longtext NOT NULL,
c7 enum('v1', 'v2'),
c7nn enum('v1', 'v2') NOT NULL
);
INSERT INTO tbl ("time",
v,
c1, c1nn, c2, c2nn, c3, c3nn, c4, c4nn, c5, c5nn, c6, c6nn, c7, c7nn) VALUES
('2023-12-21 11:30:03 UTC',
10.1,
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'v1', 'v2'),
('2023-12-21 11:31:03 UTC',
20.1,
NULL, 'bb', NULL, 'dd', NULL, 'ff', NULL, 'hh', NULL, 'jj', NULL, 'll', NULL, 'v1');
@@ -0,0 +1,107 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "type": "timeseries-wide",
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT UNIX_TIMESTAMP(\"time\") DIV 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 14:15:00 +0000 UTC | null | null |
// | 2023-12-24 14:20:00 +0000 UTC | 15 | 115 |
// | 2023-12-24 14:25:00 +0000 UTC | null | null |
// | 2023-12-24 14:30:00 +0000 UTC | null | null |
// | 2023-12-24 14:35:00 +0000 UTC | 50 | 150 |
// | 2023-12-24 14:40:00 +0000 UTC | null | null |
// | 2023-12-24 14:45:00 +0000 UTC | null | null |
// +-------------------------------+------------------+------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"type": "timeseries-wide",
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT UNIX_TIMESTAMP(\"time\") DIV 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
]
]
}
}
]
}
+15
View File
@@ -0,0 +1,15 @@
-- SELECT $__timeGroupAlias("time",5m,NULL),c,avg(v) AS "v" FROM tbl GROUP BY 1,2 ORDER BY 1,2
-- tests fill-mode=null
CREATE TABLE tbl (
`time` timestamp NOT NULL,
v double precision,
c text
);
INSERT INTO tbl (`time`, v, c) VALUES
('2023-12-24 14:21:03+00:00', 10, 'a'),
('2023-12-24 14:21:03+00:00', 110, 'b'),
('2023-12-24 14:23:03+00:00', 20, 'a'),
('2023-12-24 14:23:03+00:00', 120, 'b'),
('2023-12-24 14:39:03+00:00', 50, 'a'),
('2023-12-24 14:39:03+00:00', 150, 'b');
@@ -0,0 +1,107 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "type": "timeseries-wide",
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT UNIX_TIMESTAMP(\"time\") DIV 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 14:15:00 +0000 UTC | null | null |
// | 2023-12-24 14:20:00 +0000 UTC | 15 | 115 |
// | 2023-12-24 14:25:00 +0000 UTC | 15 | 115 |
// | 2023-12-24 14:30:00 +0000 UTC | 15 | 115 |
// | 2023-12-24 14:35:00 +0000 UTC | 50 | 150 |
// | 2023-12-24 14:40:00 +0000 UTC | 50 | 150 |
// | 2023-12-24 14:45:00 +0000 UTC | 50 | 150 |
// +-------------------------------+------------------+------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"type": "timeseries-wide",
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT UNIX_TIMESTAMP(\"time\") DIV 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
View File
@@ -0,0 +1,15 @@
-- SELECT $__timeGroupAlias("time",5m,previous),c,avg(v) AS "v" FROM tbl GROUP BY 1,2 ORDER BY 1,2
-- tests fill-mode=previous
CREATE TABLE tbl (
`time` timestamp NOT NULL,
v double precision,
c text
);
INSERT INTO tbl (`time`, v, c) VALUES
('2023-12-24 14:21:03+00:00', 10, 'a'),
('2023-12-24 14:21:03+00:00', 110, 'b'),
('2023-12-24 14:23:03+00:00', 20, 'a'),
('2023-12-24 14:23:03+00:00', 120, 'b'),
('2023-12-24 14:39:03+00:00', 50, 'a'),
('2023-12-24 14:39:03+00:00', 150, 'b');
@@ -0,0 +1,107 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "type": "timeseries-wide",
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT UNIX_TIMESTAMP(\"time\") DIV 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 14:15:00 +0000 UTC | 27 | 27 |
// | 2023-12-24 14:20:00 +0000 UTC | 15 | 115 |
// | 2023-12-24 14:25:00 +0000 UTC | 27 | 27 |
// | 2023-12-24 14:30:00 +0000 UTC | 27 | 27 |
// | 2023-12-24 14:35:00 +0000 UTC | 50 | 150 |
// | 2023-12-24 14:40:00 +0000 UTC | 27 | 27 |
// | 2023-12-24 14:45:00 +0000 UTC | 27 | 27 |
// +-------------------------------+------------------+------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"type": "timeseries-wide",
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT UNIX_TIMESTAMP(\"time\") DIV 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
]
]
}
}
]
}
+15
View File
@@ -0,0 +1,15 @@
-- SELECT $__timeGroupAlias("time",5m,27),c,avg(v) AS "v" FROM tbl GROUP BY 1,2 ORDER BY 1,2
-- tests fill-mode=value
CREATE TABLE tbl (
`time` timestamp NOT NULL,
v double precision,
c text
);
INSERT INTO tbl (`time`, v, c) VALUES
('2023-12-24 14:21:03+00:00', 10, 'a'),
('2023-12-24 14:21:03+00:00', 110, 'b'),
('2023-12-24 14:23:03+00:00', 20, 'a'),
('2023-12-24 14:23:03+00:00', 120, 'b'),
('2023-12-24 14:39:03+00:00', 50, 'a'),
('2023-12-24 14:39:03+00:00', 150, 'b');
@@ -0,0 +1,100 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT UNIX_TIMESTAMP(\"time\") DIV 300 * 300 AS \"time\",avg(v1) AS \"v1\", avg(v2) AS \"v2\" FROM tbl GROUP BY 1 ORDER BY 1"
// }
// Name:
// Dimensions: 3 Fields by 7 Rows
// +-------------------------------+------------------+------------------+
// | Name: Time | Name: v1 | Name: v2 |
// | Labels: | Labels: | Labels: |
// | Type: []*time.Time | Type: []*float64 | Type: []*float64 |
// +-------------------------------+------------------+------------------+
// | 2023-12-24 14:15:00 +0000 UTC | 27 | 27 |
// | 2023-12-24 14:20:00 +0000 UTC | 15 | 115 |
// | 2023-12-24 14:25:00 +0000 UTC | 27 | 27 |
// | 2023-12-24 14:30:00 +0000 UTC | 27 | 27 |
// | 2023-12-24 14:35:00 +0000 UTC | 50 | 150 |
// | 2023-12-24 14:40:00 +0000 UTC | 27 | 27 |
// | 2023-12-24 14:45:00 +0000 UTC | 27 | 27 |
// +-------------------------------+------------------+------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT UNIX_TIMESTAMP(\"time\") DIV 300 * 300 AS \"time\",avg(v1) AS \"v1\", avg(v2) AS \"v2\" FROM tbl GROUP BY 1 ORDER BY 1"
},
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "v1",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
},
{
"name": "v2",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
}
]
},
"data": {
"values": [
[
1703427300000,
1703427600000,
1703427900000,
1703428200000,
1703428500000,
1703428800000,
1703429100000
],
[
27,
15,
27,
27,
50,
27,
27
],
[
27,
115,
27,
27,
150,
27,
27
]
]
}
}
]
}
+12
View File
@@ -0,0 +1,12 @@
-- SELECT $__timeGroupAlias("time",5m,27),avg(v1) AS "v1", avg(v2) AS "v2" FROM tbl GROUP BY 1 ORDER BY 1
-- tests fill-mode=value
CREATE TABLE tbl (
"time" timestamp(6) NOT NULL,
v1 double precision,
v2 double precision
);
INSERT INTO tbl ("time", v1, v2) VALUES
('2023-12-24 14:21:03 UTC', 10, 110),
('2023-12-24 14:23:03 UTC', 20, 120),
('2023-12-24 14:39:03 UTC', 50, 150);
@@ -0,0 +1,36 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl WHERE false"
// }
// Name:
// Dimensions: 0 Fields by 0 Rows
// +
// +
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT * FROM tbl WHERE false"
},
"fields": []
},
"data": {
"values": []
}
}
]
}
+12
View File
@@ -0,0 +1,12 @@
-- SELECT * FROM tbl WHERE false
CREATE TABLE tbl (
`time` timestamp NOT NULL,
v double precision,
c text
);
INSERT INTO tbl (`time`, v, c) VALUES
('2023-12-24 14:30:03+00:00', 10, 'a'),
('2023-12-24 14:30:03+00:00', 110, 'b'),
('2023-12-24 14:31:03+00:00', 20, 'a'),
('2023-12-24 14:31:03+00:00', 120, 'b');
@@ -0,0 +1,36 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl WHERE false"
// }
// Name:
// Dimensions: 0 Fields by 0 Rows
// +
// +
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT * FROM tbl WHERE false"
},
"fields": []
},
"data": {
"values": []
}
}
]
}
+10
View File
@@ -0,0 +1,10 @@
-- SELECT * FROM tbl WHERE false
CREATE TABLE tbl (
`time` timestamp NOT NULL,
v1 double precision,
v2 double precision
);
INSERT INTO tbl (`time`, v1, v2) VALUES
('2023-12-24 14:30:03+00:00', 10, 110),
('2023-12-24 14:31:03+00:00', 20, 120);
+99
View File
@@ -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
]
]
}
}
]
}
+18
View File
@@ -0,0 +1,18 @@
-- SELECT * FROM tbl
CREATE TABLE tbl (
`time` timestamp NOT NULL,
v double precision,
c text
);
INSERT INTO tbl (`time`, v, c) VALUES
('2023-12-24 14:30:03+00:00', 10, 'a'),
('2023-12-24 14:30:03+00:00', 110, 'b'),
('2023-12-24 14:31:03+00:00', 20, 'a'),
('2023-12-24 14:31:03+00:00', 120, 'b'),
('2023-12-24 14:32:03+00:00', 30, 'a'),
('2023-12-24 14:32:03+00:00', 130, 'b'),
('2023-12-24 14:33:03+00:00', 40, 'a'),
('2023-12-24 14:33:03+00:00', 140, 'b'),
('2023-12-24 14:34:03+00:00', 50, 'a'),
('2023-12-24 14:34:03+00:00', 150, 'b');