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:
Gábor Farkas
2024-01-09 15:54:21 +01:00
committed by GitHub
parent 3332562900
commit ecc667c9a5
27 changed files with 2208 additions and 0 deletions
@@ -0,0 +1,112 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl"
// }
// Name:
// Dimensions: 3 Fields by 10 Rows
// +-------------------------------+------------------+-----------------+
// | Name: time | Name: v | Name: c |
// | Labels: | Labels: | Labels: |
// | Type: []*time.Time | Type: []*float64 | Type: []*string |
// +-------------------------------+------------------+-----------------+
// | 2023-12-24 14:30:03 +0000 UTC | 10 | a |
// | 2023-12-24 14:30:03 +0000 UTC | 110 | b |
// | 2023-12-24 14:31:03 +0000 UTC | 20 | a |
// | 2023-12-24 14:31:03 +0000 UTC | 120 | b |
// | 2023-12-24 14:32:03 +0000 UTC | 30 | a |
// | 2023-12-24 14:32:03 +0000 UTC | 130 | b |
// | 2023-12-24 14:33:03 +0000 UTC | 40 | a |
// | 2023-12-24 14:33:03 +0000 UTC | 140 | b |
// | 2023-12-24 14:34:03 +0000 UTC | 50 | a |
// | 2023-12-24 14:34:03 +0000 UTC | 150 | b |
// +-------------------------------+------------------+-----------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT * FROM tbl"
},
"fields": [
{
"name": "time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "v",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
},
{
"name": "c",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
}
]
},
"data": {
"values": [
[
1703428203000,
1703428203000,
1703428263000,
1703428263000,
1703428323000,
1703428323000,
1703428383000,
1703428383000,
1703428443000,
1703428443000
],
[
10,
110,
20,
120,
30,
130,
40,
140,
50,
150
],
[
"a",
"b",
"a",
"b",
"a",
"b",
"a",
"b",
"a",
"b"
]
]
}
}
]
}
@@ -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');
@@ -0,0 +1,113 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl"
// }
// Name:
// Dimensions: 4 Fields by 4 Rows
// +--------------------------------------+-----------------------------------+---------------------+-----------------------------------+
// | Name: reallyt | Name: time | Name: n | Name: timeend |
// | Labels: | Labels: | Labels: | Labels: |
// | Type: []*time.Time | Type: []*time.Time | Type: []*int64 | Type: []*time.Time |
// +--------------------------------------+-----------------------------------+---------------------+-----------------------------------+
// | 2023-12-24 14:21:27 +0000 UTC | 2023-12-21 13:21:27 +0100 CET | 1703161287 | 2023-12-21 13:21:52 +0100 CET |
// | 2023-12-24 14:21:27.724 +0000 UTC | 2023-12-21 13:21:27.724 +0100 CET | 1703161287724 | 2023-12-21 13:21:52.522 +0100 CET |
// | 2023-12-24 14:21:27.724919 +0000 UTC | 2023-12-21 13:21:27.724 +0100 CET | 1703161287724919000 | 2023-12-21 13:21:52.522 +0100 CET |
// | null | null | null | null |
// +--------------------------------------+-----------------------------------+---------------------+-----------------------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT * FROM tbl"
},
"fields": [
{
"name": "reallyt",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "n",
"type": "number",
"typeInfo": {
"frame": "int64",
"nullable": true
}
},
{
"name": "timeend",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
}
]
},
"data": {
"values": [
[
1703427687000,
1703427687724,
1703427687724,
null
],
[
1703161287000,
1703161287724,
1703161287724,
null
],
[
1703161287,
1703161287724,
1703161287724919000,
null
],
[
1703161312000,
1703161312522,
1703161312522,
null
]
],
"nanos": [
[
0,
0,
919000,
0
],
null,
null,
null
]
}
}
]
}
@@ -0,0 +1,14 @@
-- SELECT * FROM tbl
-- the time-field and time-end field gets converted to time.Time
CREATE TEMPORARY TABLE tbl (
reallyt timestamp with time zone, -- reference real timestamp
"time" bigint,
n bigint, -- normal number, it should not get converted to a timestamp
timeend bigint
);
INSERT INTO tbl (reallyt, "time", n, timeend) VALUES
('2023-12-24T14:21:27 UTC', 1703161287, 1703161287, 1703161312),
('2023-12-24T14:21:27.724 UTC', 1703161287724, 1703161287724, 1703161312522),
('2023-12-24T14:21:27.724919 UTC', 1703161287724919000, 1703161287724919000, 1703161312522186000),
(NULL, NULL, NULL, NULL);
@@ -0,0 +1,92 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl"
// }
// Name:
// Dimensions: 4 Fields by 2 Rows
// +-------------------------------+-------------------------------+----------------+-------------------------------+
// | Name: reallyt | Name: time | Name: n | Name: timeend |
// | Labels: | Labels: | Labels: | Labels: |
// | Type: []*time.Time | Type: []*time.Time | Type: []*int32 | Type: []*time.Time |
// +-------------------------------+-------------------------------+----------------+-------------------------------+
// | 2023-12-24 14:21:27 +0000 UTC | 2023-12-21 13:21:27 +0100 CET | 1703161287 | 2023-12-21 13:21:52 +0100 CET |
// | null | null | null | null |
// +-------------------------------+-------------------------------+----------------+-------------------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT * FROM tbl"
},
"fields": [
{
"name": "reallyt",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "n",
"type": "number",
"typeInfo": {
"frame": "int32",
"nullable": true
}
},
{
"name": "timeend",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
}
]
},
"data": {
"values": [
[
1703427687000,
null
],
[
1703161287000,
null
],
[
1703161287,
null
],
[
1703161312000,
null
]
]
}
}
]
}
@@ -0,0 +1,12 @@
-- SELECT * FROM tbl
-- the time-field and time-end field gets converted to time.Time
CREATE TEMPORARY TABLE tbl (
reallyt timestamp with time zone, -- reference real timestamp
"time" integer, -- 32bits, seconds-as-number is highest we can go, milliseconds-as-number does not fit
n integer, -- normal number, it should not get converted to a timestamp
timeend integer
);
INSERT INTO tbl (reallyt, "time", n, timeend) VALUES
('2023-12-24T14:21:27 UTC', 1703161287, 1703161287, 1703161312),
(NULL, NULL, NULL, NULL);
@@ -0,0 +1,140 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl"
// }
// Name:
// Dimensions: 8 Fields by 2 Rows
// +-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
// | Name: cv | Name: cvnn | Name: c | Name: cnn | Name: bpc | Name: bpcnn | Name: t | Name: tnn |
// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: |
// | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*string |
// +-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
// | one | two | three | four | five | six | seven | eight |
// | null | xtwo | null | xfour | null | xsix | null | xeight |
// +-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT * FROM tbl"
},
"fields": [
{
"name": "cv",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "cvnn",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "c",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "cnn",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "bpc",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "bpcnn",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "t",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "tnn",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
}
]
},
"data": {
"values": [
[
"one",
null
],
[
"two",
"xtwo"
],
[
"three ",
null
],
[
"four ",
"xfour "
],
[
"five",
null
],
[
"six",
"xsix"
],
[
"seven",
null
],
[
"eight",
"xeight"
]
]
}
}
]
}
@@ -0,0 +1,16 @@
-- SELECT * FROM tbl
-- test all character-based postgres data types
CREATE TEMPORARY TABLE tbl (
cv character varying(10),
cvnn character varying(10) NOT NULL,
c character(10),
cnn character(10) NOT NULL,
bpc bpchar,
bpcnn bpchar NOT NULL,
t text,
tnn text NOT NULL
);
INSERT INTO tbl (cv, cvnn, c, cnn, bpc, bpcnn, t, tnn) VALUES
('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight'),
(NULL, 'xtwo', NULL, 'xfour', NULL, 'xsix', NULL, 'xeight');
@@ -0,0 +1,226 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl"
// }
// Name:
// Dimensions: 12 Fields by 2 Rows
// +----------------------------------------+----------------------------------------+--------------------------------------+--------------------------------------+---------------------------------+---------------------------------+--------------------------------------+--------------------------------------+----------------------------------------+----------------------------------------+-----------------+-----------------+
// | Name: ts | Name: tsnn | Name: tsz | Name: tsznn | Name: d | Name: dnn | Name: t | Name: tnn | Name: tz | Name: tznn | Name: i | Name: inn |
// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: |
// | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*time.Time | Type: []*string | Type: []*string |
// +----------------------------------------+----------------------------------------+--------------------------------------+--------------------------------------+---------------------------------+---------------------------------+--------------------------------------+--------------------------------------+----------------------------------------+----------------------------------------+-----------------+-----------------+
// | 2023-11-15 05:06:07.123456 +0000 +0000 | 2023-11-15 05:06:08.123456 +0000 +0000 | 2021-07-22 11:22:33.654321 +0000 UTC | 2021-07-22 11:22:34.654321 +0000 UTC | 2023-12-20 00:00:00 +0000 +0000 | 2023-12-21 00:00:00 +0000 +0000 | 0000-01-01 12:34:56.234567 +0000 UTC | 0000-01-01 12:34:57.234567 +0000 UTC | 0000-01-01 23:12:36.765432 +0100 +0100 | 0000-01-01 23:12:37.765432 +0100 +0100 | 00:00:00.987654 | 00:00:00.887654 |
// | null | 2023-11-15 05:06:09.123456 +0000 +0000 | null | 2021-07-22 11:22:35.654321 +0000 UTC | null | 2023-12-22 00:00:00 +0000 +0000 | null | 0000-01-01 12:34:58.234567 +0000 UTC | null | 0000-01-01 23:12:38.765432 +0100 +0100 | null | 00:00:00.787654 |
// +----------------------------------------+----------------------------------------+--------------------------------------+--------------------------------------+---------------------------------+---------------------------------+--------------------------------------+--------------------------------------+----------------------------------------+----------------------------------------+-----------------+-----------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT * FROM tbl"
},
"fields": [
{
"name": "ts",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "tsnn",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "tsz",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "tsznn",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "d",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "dnn",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "t",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "tnn",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "tz",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "tznn",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "i",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "inn",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
}
]
},
"data": {
"values": [
[
1700024767123,
null
],
[
1700024768123,
1700024769123
],
[
1626952953654,
null
],
[
1626952954654,
1626952955654
],
[
1703030400000,
null
],
[
1703116800000,
1703203200000
],
[
-62167173903766,
null
],
[
-62167173902766,
-62167173901766
],
[
-62167139243235,
null
],
[
-62167139242235,
-62167139241235
],
[
"00:00:00.987654",
null
],
[
"00:00:00.887654",
"00:00:00.787654"
]
],
"nanos": [
[
456000,
0
],
[
456000,
456000
],
[
321000,
0
],
[
321000,
321000
],
null,
null,
[
567000,
0
],
[
567000,
567000
],
[
432000,
0
],
[
432000,
432000
],
null,
null
]
}
}
]
}
@@ -0,0 +1,44 @@
-- SELECT * FROM tbl
-- test all date/time-based postgres data types
CREATE TEMPORARY TABLE tbl (
ts timestamp,
tsnn timestamp NOT NULL,
tsz timestamp with time zone,
tsznn timestamp with time zone NOT NULL,
d date,
dnn date NOT NULL,
t time,
tnn time NOT NULL,
tz time with time zone,
tznn time with time zone NOT NULL,
i interval,
inn interval NOT NULL
);
INSERT INTO tbl (ts, tsnn, tsz, tsznn, d, dnn, t, tnn, tz, tznn, i, inn) VALUES (
'2023-11-15 05:06:07.123456',
'2023-11-15 05:06:08.123456',
'2021-07-22 13:22:33.654321 Europe/Berlin',
'2021-07-22 13:22:34.654321 Europe/Berlin',
'2023-12-20',
'2023-12-21',
'12:34:56.234567',
'12:34:57.234567',
'23:12:36.765432+1',
'23:12:37.765432+1',
'987654 microsecond',
'887654 microsecond'
), (
NULL,
'2023-11-15 05:06:09.123456',
NULL,
'2021-07-22 13:22:35.654321 Europe/Berlin',
NULL,
'2023-12-22',
NULL,
'12:34:58.234567',
NULL,
'23:12:38.765432+1',
NULL,
'787654 microsecond'
);
@@ -0,0 +1,188 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl"
// }
// Name:
// Dimensions: 12 Fields by 2 Rows
// +----------------+----------------+----------------+----------------+----------------+----------------+------------------+------------------+------------------+------------------+------------------+------------------+
// | Name: i16 | Name: i16nn | Name: i32 | Name: i32nn | Name: i64 | Name: i64nn | Name: n | Name: nnn | Name: f32 | Name: f32nn | Name: f64 | Name: f64nn |
// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: |
// | Type: []*int16 | Type: []*int16 | Type: []*int32 | Type: []*int32 | Type: []*int64 | Type: []*int64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 | Type: []*float64 |
// +----------------+----------------+----------------+----------------+----------------+----------------+------------------+------------------+------------------+------------------+------------------+------------------+
// | 1 | 2 | 3 | 4 | 5 | 6 | 81.75 | 7065.25 | 30.75 | 14.625 | 21.5625 | 14.25 |
// | null | 22 | null | 44 | null | 66 | null | 169.75 | null | 77.125 | null | 215.8125 |
// +----------------+----------------+----------------+----------------+----------------+----------------+------------------+------------------+------------------+------------------+------------------+------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT * FROM tbl"
},
"fields": [
{
"name": "i16",
"type": "number",
"typeInfo": {
"frame": "int16",
"nullable": true
}
},
{
"name": "i16nn",
"type": "number",
"typeInfo": {
"frame": "int16",
"nullable": true
}
},
{
"name": "i32",
"type": "number",
"typeInfo": {
"frame": "int32",
"nullable": true
}
},
{
"name": "i32nn",
"type": "number",
"typeInfo": {
"frame": "int32",
"nullable": true
}
},
{
"name": "i64",
"type": "number",
"typeInfo": {
"frame": "int64",
"nullable": true
}
},
{
"name": "i64nn",
"type": "number",
"typeInfo": {
"frame": "int64",
"nullable": true
}
},
{
"name": "n",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
},
{
"name": "nnn",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
},
{
"name": "f32",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
},
{
"name": "f32nn",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
},
{
"name": "f64",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
},
{
"name": "f64nn",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
}
}
]
},
"data": {
"values": [
[
1,
null
],
[
2,
22
],
[
3,
null
],
[
4,
44
],
[
5,
null
],
[
6,
66
],
[
81.75,
null
],
[
7065.25,
169.75
],
[
30.75,
null
],
[
14.625,
77.125
],
[
21.5625,
null
],
[
14.25,
215.8125
]
]
}
}
]
}
@@ -0,0 +1,20 @@
-- SELECT * FROM tbl
-- test all numeric postgres data types
CREATE TEMPORARY TABLE tbl (
i16 smallint,
i16nn smallint NOT NULL,
i32 integer,
i32nn integer NOT NULL,
i64 bigint,
i64nn bigint NOT NULL,
n numeric(7, 2),
nnn numeric(7,2) NOT NULL,
f32 real,
f32nn real NOT NULL,
f64 double precision,
f64nn double precision NOT NULL
);
INSERT INTO tbl (i16, i16nn, i32, i32nn, i64, i64nn, n, nnn, f32, f32nn, f64, f64nn) VALUES
(1, 2, 3, 4, 5, 6, 81.75, 7065.25, 30.75, 14.625, 21.5625, 14.25),
(NULL, 22, NULL, 44, NULL, 66, NULL, 169.75, NULL, 77.125, NULL, 215.8125);
@@ -0,0 +1,123 @@
// 🌟 This was machine generated. Do not edit. 🌟
//
// Frame[0] {
// "typeVersion": [
// 0,
// 0
// ],
// "executedQueryString": "SELECT * FROM tbl"
// }
// Name:
// Dimensions: 6 Fields by 3 Rows
// +-----------------+-----------------+-----------------+-----------------+---------------+---------------+
// | Name: m | Name: mnn | Name: bt | Name: btnn | Name: bl | Name: blnn |
// | Labels: | Labels: | Labels: | Labels: | Labels: | Labels: |
// | Type: []*string | Type: []*string | Type: []*string | Type: []*string | Type: []*bool | Type: []*bool |
// +-----------------+-----------------+-----------------+-----------------+---------------+---------------+
// | $12.34 | $23.45 | ABCD | EFGH | true | true |
// | $12.34 | $23.45 | QRST | UVWX | false | false |
// | null | $34.56 | null | abcd | null | true |
// +-----------------+-----------------+-----------------+-----------------+---------------+---------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
{
"status": 200,
"frames": [
{
"schema": {
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "SELECT * FROM tbl"
},
"fields": [
{
"name": "m",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "mnn",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "bt",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "btnn",
"type": "string",
"typeInfo": {
"frame": "string",
"nullable": true
}
},
{
"name": "bl",
"type": "boolean",
"typeInfo": {
"frame": "bool",
"nullable": true
}
},
{
"name": "blnn",
"type": "boolean",
"typeInfo": {
"frame": "bool",
"nullable": true
}
}
]
},
"data": {
"values": [
[
"$12.34",
"$12.34",
null
],
[
"$23.45",
"$23.45",
"$34.56"
],
[
"ABCD",
"QRST",
null
],
[
"EFGH",
"UVWX",
"abcd"
],
[
true,
false,
null
],
[
true,
false,
true
]
]
}
}
]
}
@@ -0,0 +1,15 @@
-- SELECT * FROM tbl
-- test the less used postgres data types
CREATE TEMPORARY TABLE tbl (
m money,
mnn money NOT NULL,
bt bytea,
btnn bytea NOT NULL,
bl boolean,
blnn boolean NOT NULL
);
INSERT INTO tbl (m, mnn, bt, btnn, bl, blnn) VALUES
(12.34, 23.45, '\x41424344'::bytea, '\x45464748'::bytea, TRUE, TRUE),
(12.34, 23.45, '\x51525354'::bytea, '\x55565758'::bytea, FALSE, FALSE),
(NULL, 34.56, NULL, '\x61626364'::bytea, NULL, TRUE);
@@ -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 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');
@@ -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
]
]
}
}
]
}
@@ -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);
@@ -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');
@@ -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
]
]
}
}
]
}
@@ -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');
@@ -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');
@@ -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');