Files
greptimedb/tests/cases/standalone/common/promql/string_identifier.sql
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

30 lines
880 B
SQL

CREATE TABLE promql_string_identifier (
ts timestamp(3) time index,
"service.name" STRING,
host STRING,
val BIGINT,
PRIMARY KEY("service.name", host),
);
INSERT INTO TABLE promql_string_identifier VALUES
(0, 'api-server', 'h1', 1),
(5000, 'db', 'host2', 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"};
-- string identifier for metric names in label matchers
-- SQLNESS SORT_RESULT 3 1
TQL EVAL (0, 10, '5s') {"promql_string_identifier"};
-- string identifier in grouping labels
-- SQLNESS SORT_RESULT 3 1
TQL EVAL (0, 10, '5s') sum by ("service.name") (promql_string_identifier);
-- escaped hex in label matcher value
-- SQLNESS SORT_RESULT 3 1
TQL EVAL (0, 10, '5s') promql_string_identifier{host="\x68\x31"};
DROP TABLE promql_string_identifier;