Files
greptimedb/tests/cases/standalone/common/promql/string_identifier.result
Ruihang Xia 9a4b7cbb32 feat: bump promql-parser to v0.7.1 (#7521)
* feat: bump promql-parser to v0.7.0

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* add sqlness tests

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update other sqlness results

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* Update tests/cases/standalone/common/tql/case_sensitive.result

Co-authored-by: Ning Sun <sunng@protonmail.com>

* remove escape on greptimedb side

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update to v0.7.1

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* remove unused deps

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: Ning Sun <sunng@protonmail.com>
2026-01-07 07:23:40 +00:00

73 lines
2.8 KiB
Plaintext

CREATE TABLE promql_string_identifier (
ts timestamp(3) time index,
"service.name" STRING,
host STRING,
val BIGINT,
PRIMARY KEY("service.name", host),
);
Affected Rows: 0
INSERT INTO TABLE promql_string_identifier VALUES
(0, 'api-server', 'h1', 1),
(5000, 'db', 'host2', 2);
Affected Rows: 2
-- string identifier for label names with dots
-- SQLNESS SORT_RESULT 3 1
TQL EVAL (0, 10, '5s') promql_string_identifier{"service.name"="api-server"};
+---------------------+--------------+------+-----+
| ts | service.name | host | val |
+---------------------+--------------+------+-----+
| 1970-01-01T00:00:00 | api-server | h1 | 1 |
| 1970-01-01T00:00:05 | api-server | h1 | 1 |
| 1970-01-01T00:00:10 | api-server | h1 | 1 |
+---------------------+--------------+------+-----+
-- string identifier for metric names in label matchers
-- SQLNESS SORT_RESULT 3 1
TQL EVAL (0, 10, '5s') {"promql_string_identifier"};
+---------------------+--------------+-------+-----+
| ts | service.name | host | val |
+---------------------+--------------+-------+-----+
| 1970-01-01T00:00:00 | api-server | h1 | 1 |
| 1970-01-01T00:00:05 | api-server | h1 | 1 |
| 1970-01-01T00:00:05 | db | host2 | 2 |
| 1970-01-01T00:00:10 | api-server | h1 | 1 |
| 1970-01-01T00:00:10 | db | host2 | 2 |
+---------------------+--------------+-------+-----+
-- string identifier in grouping labels
-- SQLNESS SORT_RESULT 3 1
TQL EVAL (0, 10, '5s') sum by ("service.name") (promql_string_identifier);
+--------------+---------------------+-----------------------------------+
| service.name | ts | sum(promql_string_identifier.val) |
+--------------+---------------------+-----------------------------------+
| api-server | 1970-01-01T00:00:00 | 1 |
| api-server | 1970-01-01T00:00:05 | 1 |
| api-server | 1970-01-01T00:00:10 | 1 |
| db | 1970-01-01T00:00:05 | 2 |
| db | 1970-01-01T00:00:10 | 2 |
+--------------+---------------------+-----------------------------------+
-- escaped hex in label matcher value
-- SQLNESS SORT_RESULT 3 1
TQL EVAL (0, 10, '5s') promql_string_identifier{host="\x68\x31"};
+---------------------+--------------+------+-----+
| ts | service.name | host | val |
+---------------------+--------------+------+-----+
| 1970-01-01T00:00:00 | api-server | h1 | 1 |
| 1970-01-01T00:00:05 | api-server | h1 | 1 |
| 1970-01-01T00:00:10 | api-server | h1 | 1 |
+---------------------+--------------+------+-----+
DROP TABLE promql_string_identifier;
Affected Rows: 0