Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbalanced parentheses in a session are considered an error #810

Closed
KVeschgini opened this issue Aug 6, 2024 · 1 comment · Fixed by #812
Closed

Unbalanced parentheses in a session are considered an error #810

KVeschgini opened this issue Aug 6, 2024 · 1 comment · Fixed by #812
Assignees
Labels
bug Something isn't working

Comments

@KVeschgini
Copy link

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
@yl-lisen
Copy link
Collaborator

yl-lisen commented Aug 7, 2024

@KVeschgini thanks for the bug report, the issue has been fixed and will be included in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants