Describe what's wrong
Unbalanced parentheses in a session are considered an error when definitions are being loaded from the store.
How to reproduce
CREATE STREAM speed (speed float64)
CREATE MATERIALIZED VIEW v AS
SELECT
window_start AS start, window_end AS end, avg(speed)
FROM
session(speed, 1m, [speed > 50,speed < 50))
GROUP BY
window_start, window_end
SHOW CREATE v
Error message and/or stacktrace
Query id: efad8ca0-5950-433c-a871-4367a0ef7680
0 rows in set. Elapsed: 0.001 sec.
Received exception from server (version 1.5.12):
Code: 62. DB::Exception: Received from localhost:8463. DB::Exception: Syntax error (in file /home/kambis/proton-data/store/90f36a1a-9142-4f7c-aac9-42c4c00ebd90/v.sql): failed at position 521 (')') (line 12, col 94): ))
GROUP BY
window_start, window_end
. Expected end of query. (SYNTAX_ERROR)
This is the content of v.sql
ATTACH MATERIALIZED VIEW _ UUID '4354ad70-167f-4f43-8963-b42ae2e93775' INTO INNER UUID '40909870-702c-4d18-a9db-db6745285516'
(
`start` datetime64(3, 'UTC'),
`end` datetime64(3, 'UTC'),
`avg(speed)` float64,
`_tp_time` datetime64(3, 'UTC') DEFAULT now64(3, 'UTC') CODEC(DoubleDelta, LZ4),
INDEX _tp_time_index _tp_time TYPE minmax GRANULARITY 2
) AS
SELECT
window_start AS start, window_end AS end, avg(speed)
FROM
session(default.speed, 1m, [speed > 50 AS __tp_session_start,speed < 50 AS __tp_session_end))
GROUP BY
window_start, window_end
and the corresponding line 12 is
session(default.speed, 1m, [speed > 50 AS __tp_session_start,speed < 50 AS __tp_session_end))
^
col 94
Describe what's wrong Unbalanced parentheses in a session are considered an error when definitions are being loaded from the store.
How to reproduce
Error message and/or stacktrace
This is the content of v.sql
and the corresponding line 12 is